use of com.enonic.xp.app.ApplicationInvalidator in project xp by enonic.
the class ApplicationServiceImplTest method configuration_comes_twice.
@Test
public void configuration_comes_twice() throws Exception {
final ApplicationKey key = ApplicationKey.from("myapp");
final Bundle bundle = deployAppBundle("myapp");
applicationRegistry.installApplication(bundle);
final Application app = service.getInstalledApplication(key);
final ApplicationInvalidator mock = mock(ApplicationInvalidator.class);
applicationRegistry.addInvalidator(mock);
applicationRegistry.configureApplication(bundle, ConfigBuilder.create().add("a", "b").build());
applicationRegistry.configureApplication(bundle, ConfigBuilder.create().add("c", "d").build());
assertEquals(ConfigBuilder.create().add("c", "d").build(), app.getConfig());
}
use of com.enonic.xp.app.ApplicationInvalidator in project xp by enonic.
the class ApplicationServiceImplTest method configuration_comes_twice_invalidators_called.
@Test
public void configuration_comes_twice_invalidators_called() throws Exception {
final ApplicationKey key = ApplicationKey.from("myapp");
final Bundle bundle = deployAppBundle("myapp");
applicationRegistry.installApplication(bundle);
service.getInstalledApplication(key);
final ApplicationInvalidator mock = mock(ApplicationInvalidator.class);
applicationRegistry.addInvalidator(mock);
applicationRegistry.configureApplication(bundle, ConfigBuilder.create().add("a", "b").build());
applicationRegistry.configureApplication(bundle, ConfigBuilder.create().add("c", "d").build());
verify(mock, times(1)).invalidate(eq(key), eq(ApplicationInvalidationLevel.FULL));
}
Aggregations