Enhancements to reuse sliboot controller
[ccsdk/apps.git] / ms / sliboot / src / test / java / org / onap / ccsdk / apps / ms / sliboot / AppTest.java
1 package org.onap.ccsdk.apps.ms.sliboot;
2
3 import org.apache.shiro.realm.Realm;
4 import org.apache.shiro.realm.text.PropertiesRealm;
5 import org.apache.shiro.spring.web.config.ShiroFilterChainDefinition;
6 import org.junit.Before;
7 import org.junit.Test;
8
9 import java.util.Map;
10
11 import static org.junit.Assert.*;
12
13 public class AppTest {
14
15     SlibootApp app;
16
17     @Before
18     public void setUp() throws Exception {
19         app = new SlibootApp();
20         System.setProperty("serviceLogicProperties", "src/test/resources/svclogic.properties");
21     }
22
23     @Test
24     public void realm() {
25         Realm realm = app.realm();
26         assertTrue(realm instanceof PropertiesRealm);
27
28
29     }
30
31     @Test
32     public void shiroFilterChainDefinition() {
33         ShiroFilterChainDefinition chainDefinition = app.shiroFilterChainDefinition();
34         Map<String, String> chainMap = chainDefinition.getFilterChainMap();
35         assertEquals("anon", chainMap.get("/**"));
36
37
38     }
39 }