ConfigurationInitializer { @NotNull static <T extends SecurityConfiguration> T initializeConfiguration(@NotNull T configuration, @NotNull SecurityProvider securityProvider, @NotNull RootProvider rootProvider, @NotNull TreeProvider treeProvider) { return initializeConfiguration(configuration, securityProvider, ConfigurationParameters.EMPTY, rootProvider, treeProvider); } private  ConfigurationInitializer();   }
@Test public void testInitConfigurationReturnsSame() { SecurityConfiguration sc = new SecurityConfiguration.Default(); assertSame(sc, ConfigurationInitializer.initializeConfiguration(sc, sp, rootProvider, treeProvider)); }
@Test public void testInitBaseConfigurationReturnsSame() { SecurityConfiguration sc = new TestConfiguration(); assertSame(sc, ConfigurationInitializer.initializeConfiguration(sc, sp, rootProvider, treeProvider)); }
@Test public void testInitConfigurationWithParamReturnsSame() { SecurityConfiguration sc = new SecurityConfiguration.Default(); assertSame(sc, ConfigurationInitializer.initializeConfiguration(sc, sp, params, rootProvider, treeProvider)); }
@Test public void testInitBaseConfigurationWithParamReturnsSame() { SecurityConfiguration sc = new TestConfiguration(); assertSame(sc, ConfigurationInitializer.initializeConfiguration(sc, sp, params, rootProvider, treeProvider)); }
@Test public void testInitNonBaseConfiguration() { SecurityConfiguration sc = new SecurityConfiguration.Default(); ConfigurationInitializer.initializeConfiguration(sc, sp, rootProvider, treeProvider); assertFalse(sc.getParameters().containsKey("key")); }
@Test public void testInitBaseConfiguration() { TestConfiguration sc = new TestConfiguration(); SecurityConfiguration afterInit = ConfigurationInitializer.initializeConfiguration(sc, sp, rootProvider, treeProvider); assertSame(sc, afterInit); assertSame(sp, sc.getSecurityProvider()); ConfigurationParameters parameters = afterInit.getParameters(); assertTrue(parameters.containsKey("key")); assertTrue(parameters.containsKey("key2")); assertEquals("initialValue", parameters.get("key")); assertEquals("initialValue", parameters.get("key2")); }
@Test public void testInitBaseConfigurationWithParam() { TestConfiguration sc = new TestConfiguration(); SecurityConfiguration afterInit = ConfigurationInitializer.initializeConfiguration(sc, sp, params, rootProvider, treeProvider); assertSame(sc, afterInit); assertSame(sp, sc.getSecurityProvider()); assertSame(rootProvider, sc.getRootProvider()); assertSame(treeProvider, sc.getTreeProvider()); ConfigurationParameters parameters = afterInit.getParameters(); assertTrue(parameters.containsKey("key")); assertTrue(parameters.containsKey("key2")); assertEquals("value", parameters.get("key")); assertEquals("initialValue", parameters.get("key2")); }