### Question:
PayaraExpressionConfigSource extends PayaraConfigSource implements ConfigSource { @Override public String getValue(String property) { String payaraExpression = properties.getProperty(property); String value = TranslatedConfigView.expandValue(payaraExpression); if (value == null || value.equals(payaraExpression)) { return null; } return value; } PayaraExpressionConfigSource(Properties properties);   PayaraExpressionConfigSource(boolean test, Properties properties); @Override int getOrdinal(); @Override Map<String, String> getProperties(); @Override String getValue(String property); @Override String getName();  }### Answer:
@Test public void testGetUndefinedProperty() { PayaraExpressionConfigSource config = new PayaraExpressionConfigSource(true, new Properties()); Assert.assertNull(config.getValue("${java.home}")); Assert.assertNull(config.getValue("java.home")); Assert.assertNull(config.getValue("wibble")); }
@Test public void testGetIncorrectProperty() { Properties properties = new Properties(); properties.put("fish.payara.alias.incorrect", "java.home"); properties.put("fish.payara.alias.incorrect.system", "{wibbly.wobbly.timey.wimey}"); properties.put("fish.payara.alias.incorrect.env", "${ENV=wibbly.wobbly.timey.wimey}"); PayaraExpressionConfigSource config = new PayaraExpressionConfigSource(true, properties); Assert.assertNull(config.getValue("fish.payara.alias.incorrect")); Assert.assertNull(config.getValue("fish.payara.alias.incorrect.system")); Assert.assertNull(config.getValue("fish.payara.alias.incorrect.env")); }
@Test public void testTranslateSystemProperty() { Properties properties = new Properties(); properties.put("fish.payara.expression.system", "${java.home}"); PayaraExpressionConfigSource config = new PayaraExpressionConfigSource(true, properties); Assert.assertEquals(System.getProperty("java.home"), config.getValue("fish.payara.expression.system")); }
@Test public void testTranslateEnvironmentProperty() { Properties properties = new Properties(); properties.put("fish.payara.expression.env", "${ENV=PATH}"); PayaraExpressionConfigSource config = new PayaraExpressionConfigSource(true, properties); Assert.assertEquals(System.getenv().get("PATH"), config.getValue("fish.payara.expression.env")); }