use of com.canoo.platform.core.context.ContextManager in project dolphin-platform by canoo.
the class ContextManagerImplTests method testRemoveGlobalContext.
@Test
public void testRemoveGlobalContext() {
// given:
final ContextManager manager = new ContextManagerImpl();
// when:
final Subscription subscription = manager.addGlobalContext("KEY", "VALUE");
subscription.unsubscribe();
// then:
Assert.assertEquals(manager.getGlobalContexts().size(), 5);
checkForGlobalContextMissing(manager, "KEY");
}
use of com.canoo.platform.core.context.ContextManager in project dolphin-platform by canoo.
the class ContextManagerImplTests method testOverrideGlobalContext.
@Test
public void testOverrideGlobalContext() {
// given:
final ContextManager manager = new ContextManagerImpl();
// when:
manager.addGlobalContext("KEY", "VALUE");
manager.addGlobalContext("KEY", "VALUE-2");
// then:
Assert.assertEquals(manager.getGlobalContexts().size(), 6);
checkForGlobalContext(manager, "KEY", "VALUE-2");
}
use of com.canoo.platform.core.context.ContextManager in project dolphin-platform by canoo.
the class ContextManagerImplTests method testGlobalContext.
@Test
public void testGlobalContext() {
// given:
final ContextManager manager = new ContextManagerImpl();
// when:
manager.addGlobalContext("KEY", "VALUE");
// then:
Assert.assertEquals(manager.getGlobalContexts().size(), 6);
checkForGlobalContext(manager, "KEY", "VALUE");
}
use of com.canoo.platform.core.context.ContextManager in project dolphin-platform by canoo.
the class ContextManagerImplTests method testGlobalContextDefaults.
@Test
public void testGlobalContextDefaults() {
// given:
final ContextManager manager = new ContextManagerImpl();
// then:
Assert.assertEquals(manager.getGlobalContexts().size(), 5);
checkForGlobalContext(manager, "hostName");
checkForGlobalContext(manager, "platform.version");
checkForGlobalContext(manager, "canonicalHostName");
checkForGlobalContext(manager, "hostAddress");
checkForGlobalContext(manager, "application.name");
}
Aggregations