NinjaPropertiesImpl implements NinjaProperties { @Override public String get(String key) { String value; try { value = compositeConfiguration.getString(key); } catch (Exception e) { value = null; } return value; } NinjaPropertiesImpl(
            NinjaMode ninjaMode);  NinjaPropertiesImpl(
            NinjaMode ninjaMode, String externalConfigurationPath); @Override String get(String key); @Override String getOrDie(String key); @Override Integer getInteger(String key); @Override Integer getIntegerOrDie(String key); @Override Boolean getBooleanOrDie(String key); @Override Boolean getBoolean(String key); void setProperty(String key, String value); void bindProperties(Binder binder); @Override boolean isProd(); @Override boolean isDev(); @Override boolean isTest(); @Override String getContextPath(); @Override void setContextPath(String contextPath); @Override Properties getAllCurrentNinjaProperties(); @Override String[] getStringArray(String key); @Override String getWithDefault(String key, String defaultValue); @Override Integer getIntegerWithDefault(String key, Integer defaultValue); @Override Boolean getBooleanWithDefault(String key, Boolean defaultValue);  }
@Test public void testSkippingThroughModesWorks() { NinjaPropertiesImpl ninjaPropertiesImpl = new NinjaPropertiesImpl(NinjaMode.test); assertEquals("test_testproperty", ninjaPropertiesImpl.get("testproperty")); ninjaPropertiesImpl = new NinjaPropertiesImpl(NinjaMode.dev); assertEquals("dev_testproperty", ninjaPropertiesImpl.get("testproperty")); assertEquals("secret", ninjaPropertiesImpl.get(NinjaConstant.applicationSecret)); ninjaPropertiesImpl = new NinjaPropertiesImpl(NinjaMode.prod); assertEquals("testproperty_without_prefix", ninjaPropertiesImpl.get("testproperty")); assertEquals("secret", ninjaPropertiesImpl.get(NinjaConstant.applicationSecret)); System.clearProperty(NinjaConstant.MODE_KEY_NAME); }
@Test public void testReferenciningOfPropertiesWorks() { NinjaProperties ninjaProperties = new NinjaPropertiesImpl(NinjaMode.dev); assertEquals("http: ninjaProperties.get("fullServerName")); }