@Test @Parameters(method = "testPerformReplacementWithTransformationRule") public void runTransformationTestHelper(String input, String regex, TransformationRule.ApplyEnum applyRule, TransformationRule.ActionEnum actionRule, String expectedOutput) { Properties actualProperties = build("git.branch", input); List<TransformationRule> transformationRules = new ArrayList<>(); transformationRules.add(new TransformationRule(applyRule, actionRule)); List<ReplacementProperty> replacementProperties = new ArrayList<>(); replacementProperties.add(new ReplacementProperty(null, null, regex, "-", true, false, transformationRules)); propertiesReplacer.performReplacement(actualProperties, replacementProperties); Properties exptecedProperties = build("git.branch", expectedOutput); assertEquals(exptecedProperties, actualProperties); }
public void performReplacement(Properties properties, List<ReplacementProperty> replacementProperties) { if ((replacementProperties != null) && (properties != null)) { for (ReplacementProperty replacementProperty: replacementProperties) { String propertyKey = replacementProperty.getProperty(); if (propertyKey == null) { performReplacementOnAllGeneratedProperties(properties, replacementProperty); } else { performReplacementOnSingleProperty(properties, replacementProperty, propertyKey); } } } }
PropertiesReplacer { public void performReplacement(Properties properties, List<ReplacementProperty> replacementProperties) { if ((replacementProperties != null) && (properties != null)) { for (ReplacementProperty replacementProperty: replacementProperties) { String propertyKey = replacementProperty.getProperty(); if (propertyKey == null) { performReplacementOnAllGeneratedProperties(properties, replacementProperty); } else { performReplacementOnSingleProperty(properties, replacementProperty, propertyKey); } } } } }
PropertiesReplacer { public void performReplacement(Properties properties, List<ReplacementProperty> replacementProperties) { if ((replacementProperties != null) && (properties != null)) { for (ReplacementProperty replacementProperty: replacementProperties) { String propertyKey = replacementProperty.getProperty(); if (propertyKey == null) { performReplacementOnAllGeneratedProperties(properties, replacementProperty); } else { performReplacementOnSingleProperty(properties, replacementProperty, propertyKey); } } } } PropertiesReplacer(LoggerBridge log, PluginParameterExpressionEvaluator expressionEvaluator); }
PropertiesReplacer { public void performReplacement(Properties properties, List<ReplacementProperty> replacementProperties) { if ((replacementProperties != null) && (properties != null)) { for (ReplacementProperty replacementProperty: replacementProperties) { String propertyKey = replacementProperty.getProperty(); if (propertyKey == null) { performReplacementOnAllGeneratedProperties(properties, replacementProperty); } else { performReplacementOnSingleProperty(properties, replacementProperty, propertyKey); } } } } PropertiesReplacer(LoggerBridge log, PluginParameterExpressionEvaluator expressionEvaluator); void performReplacement(Properties properties, List<ReplacementProperty> replacementProperties); }
PropertiesReplacer { public void performReplacement(Properties properties, List<ReplacementProperty> replacementProperties) { if ((replacementProperties != null) && (properties != null)) { for (ReplacementProperty replacementProperty: replacementProperties) { String propertyKey = replacementProperty.getProperty(); if (propertyKey == null) { performReplacementOnAllGeneratedProperties(properties, replacementProperty); } else { performReplacementOnSingleProperty(properties, replacementProperty, propertyKey); } } } } PropertiesReplacer(LoggerBridge log, PluginParameterExpressionEvaluator expressionEvaluator); void performReplacement(Properties properties, List<ReplacementProperty> replacementProperties);  }