@Test public void testPerformReplacementOnEveryPropertyAndExpectNewPropertyGenerated() { Properties actualProperties = build("git.branch", "feature/feature_name", "git.commit.author", "author#"); List<ReplacementProperty> replacementProperties = new ArrayList<>(); replacementProperties.add(new ReplacementProperty(null, "something", "^([^\\/]*)\\/([^\\/]*)$", "$1-$2", true, false, null)); propertiesReplacer.performReplacement(actualProperties, replacementProperties); Properties exptecedProperties = build("git.branch", "feature/feature_name", "git.branch.something", "feature-feature_name", "git.commit.author", "author#", "git.commit.author.something", "author#"); 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);  }