From f374d015bd591f255624cc3b683dcbf755f498dd Mon Sep 17 00:00:00 2001 From: Andrey Vokin Date: Mon, 5 Sep 2022 21:20:44 +0200 Subject: [PATCH 1/8] Support diff toolwindow in IntelliJ IDEA For the toolwindow are required the "expected" and "actual" attributes in the test-failed-output message. This fixes issue: https://github.com/cucumber/cucumber-jvm/issues/2607 --- CHANGELOG.md | 2 + .../cucumber/core/plugin/TeamCityPlugin.java | 74 ++++++++++++++++++- .../core/plugin/TeamCityPluginTest.java | 45 +++++++++++ 3 files changed, 120 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 310b9cabda..4f853389c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed +- [JUnit] Support comparison of expected and actual values in IntelliJ IDEA ([#2607](https://github.com/cucumber/cucumber-jvm/issues/2607) ## [7.6.0] - 2022-08-08 ### Changed diff --git a/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java b/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java index d249bebe0e..3160e39279 100644 --- a/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java +++ b/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java @@ -77,6 +77,9 @@ public class TeamCityPlugin implements EventListener { + "[testFinished timestamp = '%s' duration = '%s' name = '%s']"; private static final String TEMPLATE_TEST_FAILED = TEAMCITY_PREFIX + "[testFailed timestamp = '%s' duration = '%s' message = '%s' details = '%s' name = '%s']"; + + private static final String TEMPLATE_TEST_COMPARISON_FAILED = TEAMCITY_PREFIX + + "[testFailed timestamp = '%s' duration = '%s' message = '%s' details = '%s' expected = '%s' actual = '%s' name = '%s']"; private static final String TEMPLATE_TEST_IGNORED = TEAMCITY_PREFIX + "[testIgnored timestamp = '%s' duration = '%s' message = '%s' name = '%s']"; @@ -101,6 +104,11 @@ public class TeamCityPlugin implements EventListener { private static final Pattern ANNOTATION_GLUE_CODE_LOCATION_PATTERN = Pattern.compile("^(.*)\\.(.*)\\([^:]*\\)"); private static final Pattern LAMBDA_GLUE_CODE_LOCATION_PATTERN = Pattern.compile("^(.*)\\.(.*)\\(.*:.*\\)"); + private static final Pattern[] COMPARE_PATTERNS = new Pattern[] { + Pattern.compile("^expected:\\s*(.*)\\s+but was:\\s*(.*)", + Pattern.DOTALL | Pattern.CASE_INSENSITIVE), + }; + private final PrintStream out; private final List suggestions = new ArrayList<>(); private final Map> parsedTestSources = new HashMap<>(); @@ -281,7 +289,16 @@ private void printTestStepFinished(TestStepFinished event) { case AMBIGUOUS: case FAILED: { String details = printStackTrace(error); - print(TEMPLATE_TEST_FAILED, timeStamp, duration, "Step failed", details, name); + String message = error.getMessage(); + ComparisonFailureData comparisonFailureData = message != null + ? createExceptionNotification(message.trim()) + : null; + if (comparisonFailureData != null) { + print(TEMPLATE_TEST_COMPARISON_FAILED, timeStamp, duration, "Step failed", details, + comparisonFailureData.getExpected(), comparisonFailureData.getActual(), name); + } else { + print(TEMPLATE_TEST_FAILED, timeStamp, duration, "Step failed", details, name); + } break; } default: @@ -290,6 +307,26 @@ private void printTestStepFinished(TestStepFinished event) { print(TEMPLATE_TEST_FINISHED, timeStamp, duration, name); } + private static ComparisonFailureData createExceptionNotification(String message, Pattern pattern) { + final Matcher matcher = pattern.matcher(message); + if (matcher.find()) { + String expected = matcher.group(1); + String actual = matcher.group(2); + return new ComparisonFailureData(expected, actual); + } + return null; + } + + private static ComparisonFailureData createExceptionNotification(String message) { + for (Pattern pattern : COMPARE_PATTERNS) { + ComparisonFailureData result = createExceptionNotification(message, pattern); + if (result != null) { + return result; + } + } + return null; + } + private String extractName(TestStep step) { if (step instanceof PickleStepTestStep) { PickleStepTestStep pickleStepTestStep = (PickleStepTestStep) step; @@ -420,4 +457,39 @@ private String escape(String source) { .replace("]", "|]"); } + private static class ComparisonFailureData { + private final String expected; + + private final String actual; + + ComparisonFailureData(String expected, String actual) { + if (isWrappedWith(expected, '<', '>') && isWrappedWith(actual, '<', '>')) { + expected = unwrap(expected); + actual = unwrap(actual); + } + if (isWrappedWith(expected, '[', ']') && isWrappedWith(actual, '[', ']')) { + expected = unwrap(expected); + actual = unwrap(actual); + } + this.expected = expected; + this.actual = actual; + } + + private static boolean isWrappedWith(String text, char startChar, char endChar) { + return !text.isEmpty() && + text.charAt(0) == startChar && text.charAt(text.length() - 1) == endChar; + } + + private static String unwrap(String text) { + return text.substring(1, text.length() - 1); + } + + public String getExpected() { + return expected; + } + + public String getActual() { + return actual; + } + } } diff --git a/cucumber-core/src/test/java/io/cucumber/core/plugin/TeamCityPluginTest.java b/cucumber-core/src/test/java/io/cucumber/core/plugin/TeamCityPluginTest.java index 245643e914..d73e3eb3d9 100755 --- a/cucumber-core/src/test/java/io/cucumber/core/plugin/TeamCityPluginTest.java +++ b/cucumber-core/src/test/java/io/cucumber/core/plugin/TeamCityPluginTest.java @@ -342,4 +342,49 @@ void should_print_system_failure_for_failed_hooks() { "##teamcity[testFinished timestamp = '1970-01-01T12:00:00.000+0000' name = 'Before All/After All']")); } + @Test + void should_print_comparison_failure_for_failed_assert_equal() { + Feature feature = TestFeatureParser.parse("path/test.feature", "" + + "Feature: feature name\n" + + " Scenario: scenario name\n" + + " Given first step\n"); + + ByteArrayOutputStream out = new ByteArrayOutputStream(); + Runtime.builder() + .withFeatureSupplier(new StubFeatureSupplier(feature)) + .withAdditionalPlugins(new TeamCityPlugin(new PrintStream(out))) + .withEventBus(new TimeServiceEventBus(fixed(EPOCH, of("UTC")), UUID::randomUUID)) + .withBackendSupplier(new StubBackendSupplier( + emptyList(), + singletonList( + new StubStepDefinition("first step", new RuntimeException("expected: <1> but was: <2>"))), + emptyList())) + .build() + .run(); + + assertThat(out, bytesContainsString("expected = '1' actual = '2' name = 'first step']")); + } + + @Test + void should_print_comparison_failure_for_failed_assert_equal_for_strings() { + Feature feature = TestFeatureParser.parse("path/test.feature", "" + + "Feature: feature name\n" + + " Scenario: scenario name\n" + + " Given first step\n"); + + ByteArrayOutputStream out = new ByteArrayOutputStream(); + Runtime.builder() + .withFeatureSupplier(new StubFeatureSupplier(feature)) + .withAdditionalPlugins(new TeamCityPlugin(new PrintStream(out))) + .withEventBus(new TimeServiceEventBus(fixed(EPOCH, of("UTC")), UUID::randomUUID)) + .withBackendSupplier(new StubBackendSupplier( + emptyList(), + singletonList(new StubStepDefinition("first step", + new RuntimeException("expected: <[one value]> but was: <[another value]>"))), + emptyList())) + .build() + .run(); + + assertThat(out, bytesContainsString("expected = 'one value' actual = 'another value' name = 'first step']")); + } } From a7cef4fc5268da9dce441918ec00c900c2861ca0 Mon Sep 17 00:00:00 2001 From: "M.P. Korstanje" Date: Sat, 10 Sep 2022 17:57:39 +0200 Subject: [PATCH 2/8] Improve test fidelity --- .../cucumber/core/plugin/TeamCityPlugin.java | 82 ++++++++----------- .../cucumber/core/backend/StubLocation.java | 21 +++++ .../core/backend/StubStepDefinition.java | 18 ++-- .../core/plugin/TeamCityPluginTest.java | 10 ++- 4 files changed, 73 insertions(+), 58 deletions(-) create mode 100644 cucumber-core/src/test/java/io/cucumber/core/backend/StubLocation.java diff --git a/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java b/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java index 3160e39279..629338502e 100644 --- a/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java +++ b/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java @@ -45,6 +45,7 @@ import static io.cucumber.core.exception.ExceptionUtils.printStackTrace; import static java.util.Collections.emptyList; +import static java.util.Objects.requireNonNull; import static java.util.stream.Collectors.joining; /** @@ -105,7 +106,8 @@ public class TeamCityPlugin implements EventListener { private static final Pattern LAMBDA_GLUE_CODE_LOCATION_PATTERN = Pattern.compile("^(.*)\\.(.*)\\(.*:.*\\)"); private static final Pattern[] COMPARE_PATTERNS = new Pattern[] { - Pattern.compile("^expected:\\s*(.*)\\s+but was:\\s*(.*)", + // JUnit 5 AssertionFailureBuilder + Pattern.compile("expected: <(.*)> but was: <(.*)>$", Pattern.DOTALL | Pattern.CASE_INSENSITIVE), }; @@ -290,15 +292,17 @@ private void printTestStepFinished(TestStepFinished event) { case FAILED: { String details = printStackTrace(error); String message = error.getMessage(); - ComparisonFailureData comparisonFailureData = message != null - ? createExceptionNotification(message.trim()) - : null; - if (comparisonFailureData != null) { - print(TEMPLATE_TEST_COMPARISON_FAILED, timeStamp, duration, "Step failed", details, - comparisonFailureData.getExpected(), comparisonFailureData.getActual(), name); - } else { + if (message == null) { print(TEMPLATE_TEST_FAILED, timeStamp, duration, "Step failed", details, name); + break; } + ComparisonFailure comparisonFailure = ComparisonFailure.parse(message.trim()); + if (comparisonFailure == null) { + print(TEMPLATE_TEST_FAILED, timeStamp, duration, "Step failed", details, name); + break; + } + print(TEMPLATE_TEST_COMPARISON_FAILED, timeStamp, duration, "Step failed", details, + comparisonFailure.getExpected(), comparisonFailure.getActual(), name); break; } default: @@ -307,26 +311,6 @@ private void printTestStepFinished(TestStepFinished event) { print(TEMPLATE_TEST_FINISHED, timeStamp, duration, name); } - private static ComparisonFailureData createExceptionNotification(String message, Pattern pattern) { - final Matcher matcher = pattern.matcher(message); - if (matcher.find()) { - String expected = matcher.group(1); - String actual = matcher.group(2); - return new ComparisonFailureData(expected, actual); - } - return null; - } - - private static ComparisonFailureData createExceptionNotification(String message) { - for (Pattern pattern : COMPARE_PATTERNS) { - ComparisonFailureData result = createExceptionNotification(message, pattern); - if (result != null) { - return result; - } - } - return null; - } - private String extractName(TestStep step) { if (step instanceof PickleStepTestStep) { PickleStepTestStep pickleStepTestStep = (PickleStepTestStep) step; @@ -457,31 +441,35 @@ private String escape(String source) { .replace("]", "|]"); } - private static class ComparisonFailureData { - private final String expected; + private static class ComparisonFailure { - private final String actual; - - ComparisonFailureData(String expected, String actual) { - if (isWrappedWith(expected, '<', '>') && isWrappedWith(actual, '<', '>')) { - expected = unwrap(expected); - actual = unwrap(actual); - } - if (isWrappedWith(expected, '[', ']') && isWrappedWith(actual, '[', ']')) { - expected = unwrap(expected); - actual = unwrap(actual); + static ComparisonFailure parse(String message) { + for (Pattern pattern : COMPARE_PATTERNS) { + ComparisonFailure result = parse(message, pattern); + if (result != null) { + return result; + } } - this.expected = expected; - this.actual = actual; + return null; } - private static boolean isWrappedWith(String text, char startChar, char endChar) { - return !text.isEmpty() && - text.charAt(0) == startChar && text.charAt(text.length() - 1) == endChar; + static ComparisonFailure parse(String message, Pattern pattern) { + final Matcher matcher = pattern.matcher(message); + if (!matcher.find()) { + return null; + } + String expected = matcher.group(1); + String actual = matcher.group(2); + return new ComparisonFailure(expected, actual); } - private static String unwrap(String text) { - return text.substring(1, text.length() - 1); + private final String expected; + + private final String actual; + + ComparisonFailure(String expected, String actual) { + this.expected = requireNonNull(expected); + this.actual = requireNonNull(actual); } public String getExpected() { diff --git a/cucumber-core/src/test/java/io/cucumber/core/backend/StubLocation.java b/cucumber-core/src/test/java/io/cucumber/core/backend/StubLocation.java new file mode 100644 index 0000000000..63b03f418b --- /dev/null +++ b/cucumber-core/src/test/java/io/cucumber/core/backend/StubLocation.java @@ -0,0 +1,21 @@ +package io.cucumber.core.backend; + +public class StubLocation implements Located { + + private final String location; + + public StubLocation(String location) { + this.location = location; + } + + @Override + public boolean isDefinedAt(StackTraceElement stackTraceElement) { + return false; + } + + @Override + public String getLocation() { + return location; + } + +} diff --git a/cucumber-core/src/test/java/io/cucumber/core/backend/StubStepDefinition.java b/cucumber-core/src/test/java/io/cucumber/core/backend/StubStepDefinition.java index e859984026..c09c631296 100644 --- a/cucumber-core/src/test/java/io/cucumber/core/backend/StubStepDefinition.java +++ b/cucumber-core/src/test/java/io/cucumber/core/backend/StubStepDefinition.java @@ -1,5 +1,6 @@ package io.cucumber.core.backend; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Type; import java.util.List; import java.util.stream.Collectors; @@ -12,8 +13,8 @@ public class StubStepDefinition implements StepDefinition { private static final String STUBBED_LOCATION_WITH_DETAILS = "{stubbed location with details}"; private final List parameterInfos; private final String expression; - private final RuntimeException exception; - private final String location; + private final Throwable exception; + private final Located location; public StubStepDefinition(String pattern, String location, Type... types) { this(pattern, location, null, types); @@ -23,14 +24,14 @@ public StubStepDefinition(String pattern, Type... types) { this(pattern, STUBBED_LOCATION_WITH_DETAILS, null, types); } - public StubStepDefinition(String pattern, RuntimeException exception, Type... types) { + public StubStepDefinition(String pattern, Throwable exception, Type... types) { this(pattern, STUBBED_LOCATION_WITH_DETAILS, exception, types); } - public StubStepDefinition(String pattern, String location, RuntimeException exception, Type... types) { + public StubStepDefinition(String pattern, String location, Throwable exception, Type... types) { this.parameterInfos = Stream.of(types).map(StubParameterInfo::new).collect(Collectors.toList()); this.expression = pattern; - this.location = location; + this.location = new StubLocation(location); this.exception = exception; } @@ -41,13 +42,16 @@ public boolean isDefinedAt(StackTraceElement stackTraceElement) { @Override public String getLocation() { - return location; + return location.getLocation(); } @Override public void execute(Object[] args) { if (exception != null) { - throw exception; + if (exception instanceof CucumberBackendException) { + throw (CucumberBackendException) exception; + } + throw new CucumberInvocationTargetException(location, new InvocationTargetException(exception)); } assertEquals(parameterInfos.size(), args.length); diff --git a/cucumber-core/src/test/java/io/cucumber/core/plugin/TeamCityPluginTest.java b/cucumber-core/src/test/java/io/cucumber/core/plugin/TeamCityPluginTest.java index d73e3eb3d9..54fecfaac0 100755 --- a/cucumber-core/src/test/java/io/cucumber/core/plugin/TeamCityPluginTest.java +++ b/cucumber-core/src/test/java/io/cucumber/core/plugin/TeamCityPluginTest.java @@ -27,6 +27,7 @@ import static java.util.Collections.emptyList; import static java.util.Collections.singletonList; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.AssertionFailureBuilder.assertionFailure; import static org.junit.jupiter.api.Assertions.assertThrows; @DisabledOnOs(OS.WINDOWS) @@ -357,7 +358,7 @@ void should_print_comparison_failure_for_failed_assert_equal() { .withBackendSupplier(new StubBackendSupplier( emptyList(), singletonList( - new StubStepDefinition("first step", new RuntimeException("expected: <1> but was: <2>"))), + new StubStepDefinition("first step", assertionFailure().expected(1).actual(2).build())), emptyList())) .build() .run(); @@ -366,7 +367,7 @@ void should_print_comparison_failure_for_failed_assert_equal() { } @Test - void should_print_comparison_failure_for_failed_assert_equal_for_strings() { + void should_print_comparison_failure_for_failed_assert_equal_with_prefix() { Feature feature = TestFeatureParser.parse("path/test.feature", "" + "Feature: feature name\n" + " Scenario: scenario name\n" + @@ -379,8 +380,9 @@ void should_print_comparison_failure_for_failed_assert_equal_for_strings() { .withEventBus(new TimeServiceEventBus(fixed(EPOCH, of("UTC")), UUID::randomUUID)) .withBackendSupplier(new StubBackendSupplier( emptyList(), - singletonList(new StubStepDefinition("first step", - new RuntimeException("expected: <[one value]> but was: <[another value]>"))), + singletonList( + new StubStepDefinition("first step", + assertionFailure().message("oops").expected("one value").actual("another value").build())), emptyList())) .build() .run(); From d6211e2e84b33303ef150d47d69cf438f36e713b Mon Sep 17 00:00:00 2001 From: "M.P. Korstanje" Date: Sat, 10 Sep 2022 18:27:55 +0200 Subject: [PATCH 3/8] Add support for testng, junit 4 and assertJ --- .../java/io/cucumber/core/plugin/TeamCityPlugin.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java b/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java index 629338502e..69c20371bf 100644 --- a/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java +++ b/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java @@ -106,8 +106,17 @@ public class TeamCityPlugin implements EventListener { private static final Pattern LAMBDA_GLUE_CODE_LOCATION_PATTERN = Pattern.compile("^(.*)\\.(.*)\\(.*:.*\\)"); private static final Pattern[] COMPARE_PATTERNS = new Pattern[] { + // AssertJ 3 ShouldBeEqual.smartErrorMessage + Pattern.compile("(?:\r\n|\r|\n)expected: (.*)(?:\r\n|\r|\n) but was: (.*)$", + Pattern.DOTALL | Pattern.CASE_INSENSITIVE), // JUnit 5 AssertionFailureBuilder Pattern.compile("expected: <(.*)> but was: <(.*)>$", + Pattern.DOTALL | Pattern.CASE_INSENSITIVE), + // JUnit 4 Assert.assertEquals + Pattern.compile("expected:\\s?<(.*)> but was:\\s?<(.*)>$", + Pattern.DOTALL | Pattern.CASE_INSENSITIVE), + // TestNG Assert.assertEquals + Pattern.compile("expected \\[(.*)] but found \\[(.*)]\n$", Pattern.DOTALL | Pattern.CASE_INSENSITIVE), }; From 276e050b057a86e2a1fd7774a62387795527cce7 Mon Sep 17 00:00:00 2001 From: "M.P. Korstanje" Date: Sat, 10 Sep 2022 18:43:19 +0200 Subject: [PATCH 4/8] Add support for hamcrest --- .../main/java/io/cucumber/core/plugin/TeamCityPlugin.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java b/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java index 69c20371bf..895f0dddc6 100644 --- a/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java +++ b/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java @@ -106,8 +106,11 @@ public class TeamCityPlugin implements EventListener { private static final Pattern LAMBDA_GLUE_CODE_LOCATION_PATTERN = Pattern.compile("^(.*)\\.(.*)\\(.*:.*\\)"); private static final Pattern[] COMPARE_PATTERNS = new Pattern[] { + // Hamcrest 2 MatcherAssert.assertThat + Pattern.compile("expected: (.*)(?:\r\n|\r|\n) {5}but: was (.*)$", + Pattern.DOTALL | Pattern.CASE_INSENSITIVE), // AssertJ 3 ShouldBeEqual.smartErrorMessage - Pattern.compile("(?:\r\n|\r|\n)expected: (.*)(?:\r\n|\r|\n) but was: (.*)$", + Pattern.compile("expected: (.*)(?:\r\n|\r|\n) but was: (.*)$", Pattern.DOTALL | Pattern.CASE_INSENSITIVE), // JUnit 5 AssertionFailureBuilder Pattern.compile("expected: <(.*)> but was: <(.*)>$", From e1bb1719767480f64e2f30a3aba96d735c17b38f Mon Sep 17 00:00:00 2001 From: "M.P. Korstanje" Date: Sat, 10 Sep 2022 18:45:13 +0200 Subject: [PATCH 5/8] Spotless --- .../main/java/io/cucumber/core/plugin/TeamCityPlugin.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java b/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java index 895f0dddc6..6747b76d15 100644 --- a/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java +++ b/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java @@ -108,16 +108,16 @@ public class TeamCityPlugin implements EventListener { private static final Pattern[] COMPARE_PATTERNS = new Pattern[] { // Hamcrest 2 MatcherAssert.assertThat Pattern.compile("expected: (.*)(?:\r\n|\r|\n) {5}but: was (.*)$", - Pattern.DOTALL | Pattern.CASE_INSENSITIVE), + Pattern.DOTALL | Pattern.CASE_INSENSITIVE), // AssertJ 3 ShouldBeEqual.smartErrorMessage Pattern.compile("expected: (.*)(?:\r\n|\r|\n) but was: (.*)$", - Pattern.DOTALL | Pattern.CASE_INSENSITIVE), + Pattern.DOTALL | Pattern.CASE_INSENSITIVE), // JUnit 5 AssertionFailureBuilder Pattern.compile("expected: <(.*)> but was: <(.*)>$", - Pattern.DOTALL | Pattern.CASE_INSENSITIVE), + Pattern.DOTALL | Pattern.CASE_INSENSITIVE), // JUnit 4 Assert.assertEquals Pattern.compile("expected:\\s?<(.*)> but was:\\s?<(.*)>$", - Pattern.DOTALL | Pattern.CASE_INSENSITIVE), + Pattern.DOTALL | Pattern.CASE_INSENSITIVE), // TestNG Assert.assertEquals Pattern.compile("expected \\[(.*)] but found \\[(.*)]\n$", Pattern.DOTALL | Pattern.CASE_INSENSITIVE), From 3e0a702c28b56d7fd8e080896c7bc75803b478d3 Mon Sep 17 00:00:00 2001 From: "M.P. Korstanje" Date: Sat, 10 Sep 2022 18:46:02 +0200 Subject: [PATCH 6/8] Spotless --- .../src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java b/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java index 6747b76d15..c65bdee1d1 100644 --- a/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java +++ b/cucumber-core/src/main/java/io/cucumber/core/plugin/TeamCityPlugin.java @@ -118,7 +118,7 @@ public class TeamCityPlugin implements EventListener { // JUnit 4 Assert.assertEquals Pattern.compile("expected:\\s?<(.*)> but was:\\s?<(.*)>$", Pattern.DOTALL | Pattern.CASE_INSENSITIVE), - // TestNG Assert.assertEquals + // TestNG 7 Assert.assertEquals Pattern.compile("expected \\[(.*)] but found \\[(.*)]\n$", Pattern.DOTALL | Pattern.CASE_INSENSITIVE), }; From 2ff8a1c09e0295b9ccb33c17fb375ea5d2f06382 Mon Sep 17 00:00:00 2001 From: "M.P. Korstanje" Date: Thu, 15 Sep 2022 12:12:41 +0200 Subject: [PATCH 7/8] Update changelog --- CHANGELOG.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2108a0f88..66b71112ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,10 +10,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] -### Changed -- [JUnit] Support comparison of expected and actual values in IntelliJ IDEA ([#2607](https://github.com/cucumber/cucumber-jvm/issues/2607) - ### Added +- [JUnit] Support comparison of expected and actual values in IntelliJ IDEA ([#2607](https://github.com/cucumber/cucumber-jvm/issues/2607) - [Datatable] Support parsing Booleans in Datatables ([#2614](https://github.com/cucumber/cucumber-jvm/pull/2614) G. Jourdan-Weil) ## [7.7.0] - 2022-09-08 From 577d9c806578892bb0323db47661412ce9fc9bdd Mon Sep 17 00:00:00 2001 From: "M.P. Korstanje" Date: Thu, 15 Sep 2022 12:12:52 +0200 Subject: [PATCH 8/8] Update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66b71112ee..f762815166 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added -- [JUnit] Support comparison of expected and actual values in IntelliJ IDEA ([#2607](https://github.com/cucumber/cucumber-jvm/issues/2607) +- [Core] Support comparison of expected and actual values in IntelliJ IDEA ([#2607](https://github.com/cucumber/cucumber-jvm/issues/2607) - [Datatable] Support parsing Booleans in Datatables ([#2614](https://github.com/cucumber/cucumber-jvm/pull/2614) G. Jourdan-Weil) ## [7.7.0] - 2022-09-08