RunnerExpressionParser { public static String parseExpressions(final String value) { return parseExpressions(value, new SystemPropertyResolver()); } private  RunnerExpressionParser(); static String parseExpressions(final String value); static String parseExpressions(final String value, final SystemPropertyResolver valueResolver); static final String START_EXPRESSION; static final char END_EXPRESSION; }
@Test public void colon_are_not_for_defaults() { try { System.setProperty("myprop-colon", "myvalue"); assertThat(RunnerExpressionParser.parseExpressions("${myprop-colon}")).isEqualTo("myvalue"); } finally { System.clearProperty("myprop-colon"); } }
@Test public void can_use_default_chars_if_not_sys_prop() { assertThat(RunnerExpressionParser.parseExpressions("myvalue:secondvalue")).isEqualTo("myvalue:secondvalue"); }
@Test public void should_return_empty_string_if_default_value_separator_is_present_but_no_default_value() { assertThat(RunnerExpressionParser.parseExpressions("${myprop2:}")).isEqualTo(""); }
@Test public void should_scan_only_first_colon_as_property() { assertThat(RunnerExpressionParser.parseExpressions( "${giturl:http: "http: }
@Test public void should_return_value_if_no_placeholders() { assertThat(RunnerExpressionParser.parseExpressions("myvalue")).isEqualTo("myvalue"); }
@Test public void should_return_value_if_from_sys_prop_if_placeholders_used() { try { System.setProperty("myprop", "myvalue"); assertThat(RunnerExpressionParser.parseExpressions("${myprop}")).isEqualTo("myvalue"); } finally { System.clearProperty("myprop"); } }
@Test public void should_return_default_value_if_no_sys_prop() { assertThat(RunnerExpressionParser.parseExpressions("${myprop2:myvalue}")).isEqualTo("myvalue"); }