@Test
public void testCreatingInjectorWithCustomNinjaPropertiesWorks() {
// setup stuff
NinjaPropertiesImpl ninjaProperties = new NinjaPropertiesImpl(NinjaMode.test);
ninjaProperties.setProperty("key!", "value!");
NinjaServletListener ninjaServletListener = new NinjaServletListener();
ninjaServletListener.setNinjaProperties(ninjaProperties);
// start the injector:
ninjaServletListener.contextInitialized(servletContextEvent);
// test stuff
Injector injector = ninjaServletListener.getInjector();
NinjaProperties ninjaPropertiesFromServer = injector.getInstance(NinjaProperties.class);
assertThat(ninjaPropertiesFromServer.get("key!"), equalTo("value!"));
// make sure we are using the context path from the serveltcontext here
assertThat(ninjaProperties.getContextPath(), equalTo(CONTEXT_PATH));
}