ShiroConfigurationConfig { public static ShiroConfiguration getDefault() { final List<Main> mains = new ArrayList<>(); mains.add(initMain("tokenAuthRealm", "org.opendaylight.aaa.shiro.realm.TokenAuthRealm")); mains.add(initMain("securityManager.realms", "$tokenAuthRealm")); mains.add(initMain("authcBasic", "org.opendaylight.aaa.shiro.filters.ODLHttpAuthenticationFilter")); mains.add(initMain("accountingListener", "org.opendaylight.aaa.shiro.filters.AuthenticationListener")); mains.add(initMain("securityManager.authenticator.authenticationListeners", "$accountingListener")); mains.add(initMain("dynamicAuthorization", "org.opendaylight.aaa.shiro.realm.MDSALDynamicAuthorizationFilter")); final List<Urls> urls = new ArrayList<>(); urls.add(initUrl("/operations/cluster-admin**", "authcBasic, roles[admin]")); urls.add(initUrl("/v1**", "authcBasic, roles[admin]")); urls.add(initUrl("/**", "authcBasic")); return new ShiroConfigurationBuilder().setMain(mains).setUrls(urls).build(); } private  ShiroConfigurationConfig(); static ShiroConfiguration getDefault();  }
@Test public void getDefaultTest() { ShiroConfiguration configuration = ShiroConfigurationConfig.getDefault(); @Nullable List<Main> mains = configuration.getMain(); @Nullable List<Urls> urls = configuration.getUrls(); Assert.assertNotNull(mains); Assert.assertTrue(containsMainKey("tokenAuthRealm", mains)); Assert.assertTrue(containsMainKey("securityManager.realms", mains)); Assert.assertTrue(containsMainKey("authcBasic", mains)); Assert.assertTrue(containsMainKey("accountingListener", mains)); Assert.assertTrue(containsMainKey("securityManager.authenticator.authenticationListeners", mains)); Assert.assertTrue(containsMainKey("dynamicAuthorization", mains)); Assert.assertNotNull(urls); Assert.assertTrue(containsUrlKey("/operations/cluster-admin**", urls)); Assert.assertTrue(containsUrlKey("/v1**", urls)); Assert.assertTrue(containsUrlKey("/**", urls)); }