PipelineFunctionDefault implements PipelineFunction { @Override public PipelineElement apply(final PipelineElement value, final String paramsIncludingParentheses, final ExpressionResolver expressionResolver) { final PipelineElement parameter = parseAndResolveThrow(paramsIncludingParentheses, expressionResolver); return value.onUnresolved(() -> parameter); }  @Override String getName(); @Override DefaultFunctionSignature getSignature(); @Override PipelineElement apply(final PipelineElement value, final String paramsIncludingParentheses,
            final ExpressionResolver expressionResolver);  }
@Test public void applyReturnsExistingValue() { final PipelineElement input = PipelineElement.resolved(KNOWN_VALUE); final String params = "(\"" + KNOWN_FALLBACK + "\")"; assertThat(function.apply(input, params, expressionResolver)).contains(KNOWN_VALUE); }
@Test public void applyReturnsDefault() { final PipelineElement input = PipelineElement.unresolved(); final String params = "(\'" + KNOWN_FALLBACK + "\')"; assertThat(function.apply(input, params, expressionResolver)).contains(KNOWN_FALLBACK); }
@Test public void applyReturnsDefaultPlaceholder() { final PipelineElement input = PipelineElement.unresolved(); final String params = "(" + KNOWN_PLACEHOLDER + ")"; when(expressionResolver.resolveAsPipelineElement(anyString())) .thenReturn(PipelineElement.resolved(KNOWN_VALUE)); assertThat(function.apply(input, params, expressionResolver)).contains(KNOWN_VALUE); verify(expressionResolver).resolveAsPipelineElement(KNOWN_PLACEHOLDER); }