ConfigurationHelper { public String getRequiredProperty(ConfigurationValue configurationValue) { return getRequiredProperty(configurationValue, environment); }  static String getProperty(ConfigurationValue configurationValue, Environment environment); static T getProperty(ConfigurationValue configurationValue, Class<T> targetType, Environment environment); BigDecimal getBigDecimalRequiredProperty(ConfigurationValue configurationValue); BigDecimal getBigDecimalRequiredProperty(ConfigurationValue configurationValue, Environment environment); Boolean getBooleanProperty(ConfigurationValue configurationValue); Boolean getBooleanProperty(ConfigurationValue configurationValue, Environment environment); BigDecimal getNonNegativeBigDecimalRequiredProperty(ConfigurationValue configurationValue); BigDecimal getNonNegativeBigDecimalRequiredProperty(ConfigurationValue configurationValue, Environment environment); String getProperty(ConfigurationValue configurationValue); T getProperty(ConfigurationValue configurationValue, Class<T> targetType); String getPropertyAsString(ConfigurationValue configurationValue); String getRequiredProperty(ConfigurationValue configurationValue); String getRequiredProperty(ConfigurationValue configurationValue, Environment environment);  }
@Test public void testGetRequiredProperty() { ConfigurationValue configurationValue = ConfigurationValue.HERD_ENVIRONMENT; String value = configurationHelper.getRequiredProperty(configurationValue); assertEquals(configurationValue.getDefaultValue(), value); }
@Test public void testGetRequiredPropertyIllegalStateException() { ConfigurationValue configurationValue = ConfigurationValue.HERD_ENVIRONMENT; MockEnvironment environment = new MockEnvironment(); environment.setProperty(configurationValue.getKey(), BLANK_TEXT); try { configurationHelper.getRequiredProperty(configurationValue, environment); fail(); } catch (IllegalStateException e) { assertEquals(String.format("Configuration \"%s\" must have a value.", ConfigurationValue.HERD_ENVIRONMENT.getKey()), e.getMessage()); } }