From 95d047c856784393596270d66a38f2eabd9b25fc Mon Sep 17 00:00:00 2001 From: Christian Oestreich Date: Thu, 15 Dec 2022 12:50:27 -0600 Subject: [PATCH] Refactor: A few changes to modernize and make more flexible * changing some matchers from string match to pattern matching * new version 0.8.0 train * updated slf4j * updated lombok --- bom/pom.xml | 2 +- cli/pom.xml | 2 +- core/pom.xml | 2 +- distributions/debian/pom.xml | 2 +- distributions/docker/pom.xml | 2 +- distributions/linux/pom.xml | 2 +- distributions/pom.xml | 2 +- distributions/rpm/pom.xml | 2 +- enforcer/core/pom.xml | 2 +- enforcer/file/aot/pom.xml | 2 +- enforcer/file/common/pom.xml | 2 +- .../enforcer/file/common/Contains.java | 7 +-- .../enforcer/file/common/ContainsLine.java | 7 ++- .../enforcer/file/common/ContainsLineAt.java | 6 ++- .../file/common/Sha256ChecksumEquals.java | 4 +- .../enforcer/file/json/JsonValueEquals.java | 44 ++++++++++++------- .../file/common/ContainsLineAtSpec.groovy | 25 ++++++++++- .../file/common/ContainsLineSpec.groovy | 4 +- .../enforcer/file/common/ContainsSpec.groovy | 23 +++++++++- .../common/Sha256ChecksumEqualsSpec.groovy | 30 +++++++++++++ .../file/json/JsonValueEqualsSpec.groovy | 2 + .../file/yaml/YamlValueEqualsSpec.groovy | 2 + enforcer/file/core/pom.xml | 2 +- enforcer/file/docker/pom.xml | 2 +- enforcer/file/maven/pom.xml | 2 +- enforcer/file/pom.xml | 2 +- enforcer/file/registry/pom.xml | 2 +- enforcer/pom.xml | 2 +- exec/pom.xml | 2 +- pom.xml | 15 +++---- 30 files changed, 150 insertions(+), 55 deletions(-) diff --git a/bom/pom.xml b/bom/pom.xml index bb64361..09f6f46 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk - 0.7.2-SNAPSHOT + 0.8.0-SNAPSHOT sourcehawk-bom diff --git a/cli/pom.xml b/cli/pom.xml index 51feafd..4c24ec9 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -8,7 +8,7 @@ sourcehawk com.optum.sourcehawk - 0.7.2-SNAPSHOT + 0.8.0-SNAPSHOT sourcehawk-cli diff --git a/core/pom.xml b/core/pom.xml index 6f98e5e..548e352 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk - 0.7.2-SNAPSHOT + 0.8.0-SNAPSHOT ../pom.xml diff --git a/distributions/debian/pom.xml b/distributions/debian/pom.xml index 8dd5950..1ae4853 100644 --- a/distributions/debian/pom.xml +++ b/distributions/debian/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk-dist - 0.7.2-SNAPSHOT + 0.8.0-SNAPSHOT ../pom.xml diff --git a/distributions/docker/pom.xml b/distributions/docker/pom.xml index 2f77b84..f2bd5bc 100644 --- a/distributions/docker/pom.xml +++ b/distributions/docker/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk-dist - 0.7.2-SNAPSHOT + 0.8.0-SNAPSHOT ../pom.xml diff --git a/distributions/linux/pom.xml b/distributions/linux/pom.xml index 8ce9308..2ce21a6 100644 --- a/distributions/linux/pom.xml +++ b/distributions/linux/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk-dist - 0.7.2-SNAPSHOT + 0.8.0-SNAPSHOT ../pom.xml diff --git a/distributions/pom.xml b/distributions/pom.xml index 22b3f1e..dbf5372 100644 --- a/distributions/pom.xml +++ b/distributions/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk - 0.7.2-SNAPSHOT + 0.8.0-SNAPSHOT ../pom.xml diff --git a/distributions/rpm/pom.xml b/distributions/rpm/pom.xml index 0170b55..ff1312b 100644 --- a/distributions/rpm/pom.xml +++ b/distributions/rpm/pom.xml @@ -8,7 +8,7 @@ sourcehawk-dist com.optum.sourcehawk - 0.7.2-SNAPSHOT + 0.8.0-SNAPSHOT sourcehawk-dist-rpm diff --git a/enforcer/core/pom.xml b/enforcer/core/pom.xml index 0d94112..f79a1dd 100644 --- a/enforcer/core/pom.xml +++ b/enforcer/core/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk-enforcer - 0.7.2-SNAPSHOT + 0.8.0-SNAPSHOT ../pom.xml diff --git a/enforcer/file/aot/pom.xml b/enforcer/file/aot/pom.xml index ba412fa..bd1b6f0 100644 --- a/enforcer/file/aot/pom.xml +++ b/enforcer/file/aot/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk-enforcer-file - 0.7.2-SNAPSHOT + 0.8.0-SNAPSHOT ../pom.xml diff --git a/enforcer/file/common/pom.xml b/enforcer/file/common/pom.xml index 3647cde..e9c7b3d 100644 --- a/enforcer/file/common/pom.xml +++ b/enforcer/file/common/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk-enforcer-file - 0.7.2-SNAPSHOT + 0.8.0-SNAPSHOT ../pom.xml diff --git a/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/common/Contains.java b/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/common/Contains.java index 55e2d61..55f1872 100644 --- a/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/common/Contains.java +++ b/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/common/Contains.java @@ -10,6 +10,7 @@ import java.io.IOException; import java.io.InputStream; +import java.util.regex.Pattern; /** * An enforcer which is responsible for enforcing that file contains a string @@ -21,7 +22,7 @@ @AllArgsConstructor(staticName = "substring") public class Contains extends AbstractFileEnforcer { - private static final String MESSAGE_TEMPLATE = "File does not contain the sub string [%s]"; + private static final String MESSAGE_TEMPLATE = "File contain the sub string [%s] failed"; /** * The substring that is expected to be found in the file @@ -32,8 +33,8 @@ public class Contains extends AbstractFileEnforcer { /** {@inheritDoc} */ @Override public EnforcerResult enforceInternal(@NonNull final InputStream actualFileInputStream) throws IOException { - val actualFileContent = toString(actualFileInputStream); - if (!actualFileContent.contains(expectedSubstring)) { + val p = Pattern.compile(expectedSubstring); + if (!p.matcher(toString(actualFileInputStream)).find()) { return EnforcerResult.failed(String.format(MESSAGE_TEMPLATE, expectedSubstring)); } return EnforcerResult.passed(); diff --git a/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/common/ContainsLine.java b/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/common/ContainsLine.java index 544a933..f8c88f7 100644 --- a/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/common/ContainsLine.java +++ b/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/common/ContainsLine.java @@ -13,6 +13,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.util.regex.Pattern; /** * An enforcer which is responsible for enforcing that file contains an entire line @@ -24,14 +25,16 @@ @AllArgsConstructor(staticName = "contains") public class ContainsLine extends AbstractFileEnforcer { - private static final String MESSAGE_TEMPLATE = "File does not contain the line [%s]"; + private static final String MESSAGE_TEMPLATE = "File contains line [%s] failed"; /** * The line that is expected to be found in the file */ protected final String expectedLine; - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public EnforcerResult enforceInternal(@NonNull final InputStream actualFileInputStream) throws IOException { try (val bufferedFileReader = new BufferedReader(new InputStreamReader((actualFileInputStream)))) { diff --git a/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/common/ContainsLineAt.java b/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/common/ContainsLineAt.java index e52eb94..9b0ee9e 100644 --- a/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/common/ContainsLineAt.java +++ b/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/common/ContainsLineAt.java @@ -19,6 +19,7 @@ import java.util.Collections; import java.util.Optional; import java.util.function.Predicate; +import java.util.regex.Pattern; /** * An enforcer which is responsible for enforcing that file contains an entire line at a specific line number. @@ -30,7 +31,7 @@ @AllArgsConstructor(staticName = "containsAt") public class ContainsLineAt extends AbstractFileEnforcer implements FileResolver { - private static final String MESSAGE_TEMPLATE = "File does not contain the line [%s] at line number [%d]"; + private static final String MESSAGE_TEMPLATE = "File contains line [%s] at line number [%d] failed"; private static final String UPDATE_MESSAGE_TEMPLATE = "File line number [%d] has been updated to value [%s]"; /** @@ -51,7 +52,8 @@ public EnforcerResult enforceInternal(@NonNull final InputStream actualFileInput } private Predicate getPredicate() { - return actual -> StringUtils.equals(StringUtils.removeNewLines(expectedLine), StringUtils.removeNewLines(actual)); + val pattern = Pattern.compile(expectedLine); + return actual -> StringUtils.equals(StringUtils.removeNewLines(expectedLine), StringUtils.removeNewLines(actual)) || pattern.matcher(actual).matches(); } /** diff --git a/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/common/Sha256ChecksumEquals.java b/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/common/Sha256ChecksumEquals.java index c559c9c..cc493b0 100644 --- a/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/common/Sha256ChecksumEquals.java +++ b/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/common/Sha256ChecksumEquals.java @@ -13,6 +13,7 @@ import java.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; +import java.util.regex.Pattern; /** * An enforcer which is responsible for enforcing that SHA-256 checksum of a file's contents match @@ -36,7 +37,8 @@ public class Sha256ChecksumEquals extends AbstractFileEnforcer { @Override public EnforcerResult enforceInternal(@NonNull final InputStream actualFileInputStream) throws IOException { val actualChecksum = checksum(actualFileInputStream); - if (expectedChecksum.equals(actualChecksum)) { + val pattern = Pattern.compile(expectedChecksum); + if (expectedChecksum.equals(actualChecksum) || pattern.matcher(actualChecksum).matches()) { return EnforcerResult.passed(); } return EnforcerResult.failed(DEFAULT_MESSAGE); diff --git a/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/json/JsonValueEquals.java b/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/json/JsonValueEquals.java index 082d6b7..22d4672 100644 --- a/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/json/JsonValueEquals.java +++ b/enforcer/file/common/src/main/java/com/optum/sourcehawk/enforcer/file/json/JsonValueEquals.java @@ -26,6 +26,7 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; +import java.util.regex.Pattern; import java.util.stream.Collectors; /** @@ -48,7 +49,7 @@ public class JsonValueEquals extends AbstractFileEnforcer implements FileResolve /** * Key: The JsonPointer expression to retrieve the value - * + *

* Value: The expected value which the query should evaluate to */ private final Map expectations; @@ -57,14 +58,16 @@ public class JsonValueEquals extends AbstractFileEnforcer implements FileResolve * Create with a single path query and expected value * * @param jsonPointerExpression the JSON pointer expression - * @param expectedValue the expected value + * @param expectedValue the expected value * @return the enforcer */ public static JsonValueEquals equals(final String jsonPointerExpression, final Object expectedValue) { return JsonValueEquals.equals(Collections.singletonMap(jsonPointerExpression, expectedValue)); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public EnforcerResult enforceInternal(@NonNull final InputStream actualFileInputStream) { final JsonNode jsonNode; @@ -85,9 +88,9 @@ public EnforcerResult enforceInternal(@NonNull final InputStream actualFileInput /** * Enforce individual json path queries with expected value * - * @param jsonNode the JSON node - * @param jsonPointerExpression the JSON pointer expression - * @param expectedValue the expected value + * @param jsonNode the JSON node + * @param jsonPointerExpression the JSON pointer expression + * @param expectedValue the expected value * @return The message to be added, otherwise {@link Optional#empty()} */ private static Optional enforce(final JsonNode jsonNode, final String jsonPointerExpression, final Object expectedValue) { @@ -99,13 +102,15 @@ private static Optional enforce(final JsonNode jsonNode, final String js if (jsonNodeValueEquals(actualJsonNode, expectedValue)) { return Optional.empty(); } - return Optional.of(String.format(NOT_EQUAL_MESSAGE_TEMPLATE, jsonPointerExpression, actualJsonNode.asText(), expectedValue)); + return Optional.of(String.format(NOT_EQUAL_MESSAGE_TEMPLATE, jsonPointerExpression, actualJsonNode.asText(), expectedValue)); } catch (final Exception e) { return Optional.of(String.format(QUERY_ERROR_TEMPLATE, jsonPointerExpression, e.getMessage())); } } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ResolverResult resolve(final @NonNull InputStream actualFileInputStream, final @NonNull Writer outputFileWriter) throws IOException { final JsonNode rootJsonNode; @@ -126,9 +131,9 @@ public ResolverResult resolve(final @NonNull InputStream actualFileInputStream, /** * Resolve an individual json path query with the expected value * - * @param rootJsonNode the root JSON node + * @param rootJsonNode the root JSON node * @param jsonPointerExpression the JSON pointer expression - * @param expectedValue the expected value + * @param expectedValue the expected value * @return the resolver result */ private static ResolverResult resolve(final JsonNode rootJsonNode, final String jsonPointerExpression, final Object expectedValue) { @@ -162,8 +167,8 @@ private static ResolverResult resolve(final JsonNode rootJsonNode, final String * Update the actual node with the expected value * * @param parentObjectNode the parent object node - * @param childNodeName the child node name - * @param expectedValue the expected value + * @param childNodeName the child node name + * @param expectedValue the expected value */ private static void updateObjectNodeValue(final ObjectNode parentObjectNode, final String childNodeName, final Object expectedValue) { if (expectedValue instanceof Boolean) { @@ -188,8 +193,8 @@ private static void updateObjectNodeValue(final ObjectNode parentObjectNode, fin * * @param parentArrayNode the parent object node * @param actualNodeIndex the actual node index in the array - * @param expectedValue the expected value - * @param missing true if node does not currently exist, false otherwise + * @param expectedValue the expected value + * @param missing true if node does not currently exist, false otherwise */ @SuppressWarnings("squid:S3776") private static void updateArrayNodeValue(final ArrayNode parentArrayNode, final int actualNodeIndex, final Object expectedValue, final boolean missing) { @@ -241,15 +246,20 @@ private static void updateArrayNodeValue(final ArrayNode parentArrayNode, final /** * Determine if the {@code jsonNode} value equals that of the {@code expectedValue} * - * @param jsonNode the JSON node to retrieve the value from + * @param jsonNode the JSON node to retrieve the value from * @param expectedValue the expected value * @return true if they are equal, false otherwise */ private static boolean jsonNodeValueEquals(final JsonNode jsonNode, final Object expectedValue) { - return (expectedValue instanceof CharSequence && StringUtils.equals((CharSequence) expectedValue, jsonNode.textValue())) + return (expectedValue instanceof CharSequence && equalsOrMatches(jsonNode, (CharSequence) expectedValue)) || (expectedValue instanceof Number && expectedValue == jsonNode.numberValue()) || (expectedValue instanceof Boolean && (boolean) expectedValue == jsonNode.booleanValue()) - || Objects.equals(expectedValue.toString(), jsonNode.asText()); + || Objects.equals(expectedValue.toString(), jsonNode.asText()) + || Pattern.compile(jsonNode.asText()).matcher(expectedValue.toString()).matches(); } + private static boolean equalsOrMatches(JsonNode jsonNode, CharSequence expectedValue) { + return StringUtils.equals(expectedValue, jsonNode.textValue()) + || Pattern.compile(expectedValue.toString()).matcher(jsonNode.textValue()).matches(); + } } diff --git a/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/common/ContainsLineAtSpec.groovy b/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/common/ContainsLineAtSpec.groovy index 0859117..ff83b09 100644 --- a/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/common/ContainsLineAtSpec.groovy +++ b/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/common/ContainsLineAtSpec.groovy @@ -41,8 +41,31 @@ class ContainsLineAtSpec extends Specification { where: expectedLine | expectedLineNumber + '^(?:(?!include).)*$' | 5 '^ Here is a special character: $' | 5 'Perhaps I should include a double " and a single \' as well...' | 7 + '.*I should include a double " and a single \' as well.*' | 7 + } + + @Unroll + def "enforce - NOT #expectedLine - #expectedLineNumber (passed)"() { + given: + ContainsLineAt containsLineAt = ContainsLineAt.containsAt(expectedLine, expectedLineNumber) + InputStream fileInputStream = IoUtil.getResourceAsStream('/file.txt') + + when: + EnforcerResult result = containsLineAt.enforce(fileInputStream) + + then: + result + !result.passed + result.messages + + where: + expectedLine | expectedLineNumber + '![\\^ Here is a special character: \\$]' | 5 + '^(?:(?!special character).)*$' | 5 + '![Perhaps I should include a double " and a single \' as well...]' | 7 } @Unroll @@ -58,7 +81,7 @@ class ContainsLineAtSpec extends Specification { result !result.passed result.messages - result.messages[0] == "File does not contain the line [$expectedLine] at line number [$expectedLineNumber]" + result.messages[0] == "File contains line [$expectedLine] at line number [$expectedLineNumber] failed" where: expectedLine | expectedLineNumber diff --git a/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/common/ContainsLineSpec.groovy b/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/common/ContainsLineSpec.groovy index 4687b15..e8eaade 100644 --- a/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/common/ContainsLineSpec.groovy +++ b/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/common/ContainsLineSpec.groovy @@ -55,11 +55,11 @@ class ContainsLineSpec extends Specification { result !result.passed result.messages - result.messages[0] == "File does not contain the line [$expectedLine]" + result.messages[0] == "File contains line [$expectedLine] failed" where: expectedLine << [ - 'Here is a special character: $', + 'Here is a special character: \\$', 'Perhaps I should include a double " and a single \' as well' ] } diff --git a/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/common/ContainsSpec.groovy b/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/common/ContainsSpec.groovy index 0befcc3..ef4b4cd 100644 --- a/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/common/ContainsSpec.groovy +++ b/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/common/ContainsSpec.groovy @@ -42,6 +42,27 @@ class ContainsSpec extends Specification { ] } + @Unroll + def "enforce - NOT #expectedSubstring (passed)"() { + given: + Contains contains = Contains.substring(expectedSubstring) + InputStream fileInputStream = IoUtil.getResourceAsStream('/file.txt') + + when: + EnforcerResult result = contains.enforce(fileInputStream) + + then: + result + !result.passed + result.messages + + where: + expectedSubstring << [ + '![character]', + '![I should include]' + ] + } + @Unroll def "enforce - #expectedSubstring (failed)"() { given: @@ -55,7 +76,7 @@ class ContainsSpec extends Specification { result !result.passed result.messages - result.messages[0] == "File does not contain the sub string [$expectedSubstring]" + result.messages[0] == "File contain the sub string [$expectedSubstring] failed" where: expectedSubstring << [ diff --git a/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/common/Sha256ChecksumEqualsSpec.groovy b/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/common/Sha256ChecksumEqualsSpec.groovy index e74e4d2..9229f82 100644 --- a/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/common/Sha256ChecksumEqualsSpec.groovy +++ b/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/common/Sha256ChecksumEqualsSpec.groovy @@ -35,6 +35,36 @@ class Sha256ChecksumEqualsSpec extends Specification { !enforcerResult.messages } + def "enforce regex (passed))"() { + given: + String expectedChecksum = "a6179a.*" + Sha256ChecksumEquals sha256ChecksumEquals = Sha256ChecksumEquals.equals(expectedChecksum) + InputStream fileInputStream = IoUtil.getResourceAsStream("/checksum.txt") + + when: + EnforcerResult enforcerResult = sha256ChecksumEquals.enforce(fileInputStream) + + then: + enforcerResult + enforcerResult.passed + !enforcerResult.messages + } + + def "enforce regex negate (passed))"() { + given: + String expectedChecksum = "^(?:(?!abc123).)*\$" + Sha256ChecksumEquals sha256ChecksumEquals = Sha256ChecksumEquals.equals(expectedChecksum) + InputStream fileInputStream = IoUtil.getResourceAsStream("/checksum.txt") + + when: + EnforcerResult enforcerResult = sha256ChecksumEquals.enforce(fileInputStream) + + then: + enforcerResult + enforcerResult.passed + !enforcerResult.messages + } + def "enforce (failed))"() { given: String expectedChecksum = "123" diff --git a/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/json/JsonValueEqualsSpec.groovy b/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/json/JsonValueEqualsSpec.groovy index f0fdb71..56fa02b 100644 --- a/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/json/JsonValueEqualsSpec.groovy +++ b/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/json/JsonValueEqualsSpec.groovy @@ -47,6 +47,8 @@ class JsonValueEqualsSpec extends Specification { '/make' | 'Raleigh' '/size/value' | 60 '/components/0' | 'handlebars' + '/components/0' | 'handle.*' + '/components/0' | '^(?:(?!pedals).)*$' } @Unroll diff --git a/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/yaml/YamlValueEqualsSpec.groovy b/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/yaml/YamlValueEqualsSpec.groovy index b4ac3ca..fc2ba25 100644 --- a/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/yaml/YamlValueEqualsSpec.groovy +++ b/enforcer/file/common/src/test/groovy/com/optum/sourcehawk/enforcer/file/yaml/YamlValueEqualsSpec.groovy @@ -41,6 +41,8 @@ class YamlValueEqualsSpec extends Specification { '/make' | 'Raleigh' '/size/value' | 60 '/components/0' | 'handlebars' + '/components/0' | 'handle.*' + '/components/0' | '^(?:(?!pedals).)*$' } def "enforce - map (passed)"() { diff --git a/enforcer/file/core/pom.xml b/enforcer/file/core/pom.xml index 06ba9db..34788a8 100644 --- a/enforcer/file/core/pom.xml +++ b/enforcer/file/core/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk-enforcer-file - 0.7.2-SNAPSHOT + 0.8.0-SNAPSHOT ../pom.xml diff --git a/enforcer/file/docker/pom.xml b/enforcer/file/docker/pom.xml index 779cfaf..23a5cf5 100644 --- a/enforcer/file/docker/pom.xml +++ b/enforcer/file/docker/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk-enforcer-file - 0.7.2-SNAPSHOT + 0.8.0-SNAPSHOT ../pom.xml diff --git a/enforcer/file/maven/pom.xml b/enforcer/file/maven/pom.xml index 6f91426..57cc542 100644 --- a/enforcer/file/maven/pom.xml +++ b/enforcer/file/maven/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk-enforcer-file - 0.7.2-SNAPSHOT + 0.8.0-SNAPSHOT ../pom.xml diff --git a/enforcer/file/pom.xml b/enforcer/file/pom.xml index de3f2ef..96395d3 100644 --- a/enforcer/file/pom.xml +++ b/enforcer/file/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk-enforcer - 0.7.2-SNAPSHOT + 0.8.0-SNAPSHOT ../pom.xml diff --git a/enforcer/file/registry/pom.xml b/enforcer/file/registry/pom.xml index e7f10e3..5deb7de 100644 --- a/enforcer/file/registry/pom.xml +++ b/enforcer/file/registry/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk-enforcer-file - 0.7.2-SNAPSHOT + 0.8.0-SNAPSHOT ../pom.xml diff --git a/enforcer/pom.xml b/enforcer/pom.xml index c6954e5..e5aad34 100644 --- a/enforcer/pom.xml +++ b/enforcer/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk - 0.7.2-SNAPSHOT + 0.8.0-SNAPSHOT ../pom.xml diff --git a/exec/pom.xml b/exec/pom.xml index 5f12f1d..bff4a8a 100644 --- a/exec/pom.xml +++ b/exec/pom.xml @@ -8,7 +8,7 @@ com.optum.sourcehawk sourcehawk - 0.7.2-SNAPSHOT + 0.8.0-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index 7617347..b717094 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ sourcehawk - 0.7.2-SNAPSHOT + 0.8.0-SNAPSHOT pom Sourcehawk @@ -22,7 +22,8 @@ 0.97 - 1.7.32 + 1.7.36 + 1.18.24 e1 @@ -34,9 +35,8 @@ brianwyka - Brian Wyka} - brian.wyka@optum.com - Optum + Brian Wyka + brian.wyka@gmail.com Project Lead @@ -44,8 +44,7 @@ ctoestreich Christian Oestreich - christian.oestreich@optum.com - Optum + acetrike@yahoo.com Project Lead @@ -95,7 +94,7 @@ com.fasterxml.jackson jackson-bom - 2.12.5 + 2.12.7.20221012 import pom