ParameterUtilities { public String convertSingleParameterToTemplateKey( final String xlsTemplate, final ParameterizedValueBuilder.Part part ) { final StringBuffer result = new StringBuffer(); final Matcher matcherSingleParameter = patternSingleParameter.matcher( xlsTemplate ); while ( matcherSingleParameter.find() ) { matcherSingleParameter.appendReplacement( result, "@{" + PARAMETER_PREFIX + parameterCounter + "}" ); } parameterCounter++; matcherSingleParameter.appendTail( result ); return assertTemplateKeyConversion( result, part ); }  String convertIndexedParametersToTemplateKeys( final String xlsTemplate,
                                                          final ParameterizedValueBuilder.Part part ); String convertSingleParameterToTemplateKey( final String xlsTemplate,
                                                       final ParameterizedValueBuilder.Part part ); Set<String> extractTemplateKeys( final String template );  }
@Test public void testSingleParameter_LHSFieldValue() { final String result = utilities.convertSingleParameterToTemplateKey( "field1 == $param", ParameterizedValueBuilder.Part.LHS ); assertEquals( "field1 == \"@{param1}\"", result ); }
@Test public void testSingleParameter_LHSFieldName() { final String result = utilities.convertSingleParameterToTemplateKey( "$param != null", ParameterizedValueBuilder.Part.LHS ); assertEquals( "@{param1} != null", result ); }
@Test public void testSingleParameter_RHSFieldValue() { final String result = utilities.convertSingleParameterToTemplateKey( "setField( $param )", ParameterizedValueBuilder.Part.RHS ); assertEquals( "setField( @{param1} )", result ); }