elharo commented on code in PR #772: URL: https://github.com/apache/maven-surefire/pull/772#discussion_r1888878483
########## surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProviderTest.java: ########## @@ -199,14 +199,22 @@ public void allGivenTestsToRunAreInvoked() throws Exception { TestsToRun testsToRun = newTestsToRun(TestClass1.class, TestClass2.class); invokeProvider(provider, testsToRun); - assertThat(executionListener.summaries).hasSize(1); + assertThat(executionListener.summaries).hasSize(2); TestExecutionSummary summary = executionListener.summaries.get(0); - assertEquals(TestClass1.TESTS_FOUND + TestClass2.TESTS_FOUND, summary.getTestsFoundCount()); - assertEquals(TestClass1.TESTS_STARTED + TestClass2.TESTS_STARTED, summary.getTestsStartedCount()); - assertEquals(TestClass1.TESTS_SKIPPED + TestClass2.TESTS_SKIPPED, summary.getTestsSkippedCount()); - assertEquals(TestClass1.TESTS_SUCCEEDED + TestClass2.TESTS_SUCCEEDED, summary.getTestsSucceededCount()); - assertEquals(TestClass1.TESTS_ABORTED + TestClass2.TESTS_ABORTED, summary.getTestsAbortedCount()); - assertEquals(TestClass1.TESTS_FAILED + TestClass2.TESTS_FAILED, summary.getTestsFailedCount()); + assertEquals(TestClass1.TESTS_FOUND, summary.getTestsFoundCount()); + assertEquals(TestClass1.TESTS_STARTED, summary.getTestsStartedCount()); + assertEquals(TestClass1.TESTS_SKIPPED, summary.getTestsSkippedCount()); + assertEquals(TestClass1.TESTS_SUCCEEDED, summary.getTestsSucceededCount()); + assertEquals(TestClass1.TESTS_ABORTED, summary.getTestsAbortedCount()); + assertEquals(TestClass1.TESTS_FAILED, summary.getTestsFailedCount()); + + summary = executionListener.summaries.get(1); Review Comment: Try to avoid reusing local variables. ########## surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProviderTest.java: ########## @@ -682,14 +718,22 @@ public void allDiscoveredTestsAreInvokedForNullArgument() throws Exception { assertThat(report.getValue().getSourceName()).isEqualTo(TestClass2.class.getName()); assertThat(report.getValue().getName()).isNull(); - assertThat(executionListener.summaries).hasSize(1); + assertThat(executionListener.summaries).hasSize(2); TestExecutionSummary summary = executionListener.summaries.get(0); - assertEquals(TestClass1.TESTS_FOUND + TestClass2.TESTS_FOUND, summary.getTestsFoundCount()); - assertEquals(TestClass1.TESTS_STARTED + TestClass2.TESTS_STARTED, summary.getTestsStartedCount()); - assertEquals(TestClass1.TESTS_SKIPPED + TestClass2.TESTS_SKIPPED, summary.getTestsSkippedCount()); - assertEquals(TestClass1.TESTS_SUCCEEDED + TestClass2.TESTS_SUCCEEDED, summary.getTestsSucceededCount()); - assertEquals(TestClass1.TESTS_ABORTED + TestClass2.TESTS_ABORTED, summary.getTestsAbortedCount()); - assertEquals(TestClass1.TESTS_FAILED + TestClass2.TESTS_FAILED, summary.getTestsFailedCount()); + assertEquals(TestClass1.TESTS_FOUND, summary.getTestsFoundCount()); + assertEquals(TestClass1.TESTS_STARTED, summary.getTestsStartedCount()); + assertEquals(TestClass1.TESTS_SKIPPED, summary.getTestsSkippedCount()); + assertEquals(TestClass1.TESTS_SUCCEEDED, summary.getTestsSucceededCount()); + assertEquals(TestClass1.TESTS_ABORTED, summary.getTestsAbortedCount()); + assertEquals(TestClass1.TESTS_FAILED, summary.getTestsFailedCount()); + + summary = executionListener.summaries.get(1); Review Comment: reused local variable -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org