Skip to content

Commit 7160ab7

Browse files
committed
Filter out synthetic methods in TestWatcherTests
Because the `$jacocoInit()` method should not be checked for. See #1862
1 parent 9aa4c24 commit 7160ab7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestWatcherTests.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
package org.junit.jupiter.engine.extension;
1212

13+
import static java.util.function.Predicate.not;
1314
import static java.util.stream.Collectors.toUnmodifiableList;
1415
import static org.assertj.core.api.Assertions.assertThat;
1516
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -54,7 +55,9 @@
5455
class TestWatcherTests extends AbstractJupiterTestEngineTests {
5556

5657
private static final List<String> testWatcherMethodNames = Arrays.stream(TestWatcher.class.getDeclaredMethods())//
57-
.map(Method::getName).collect(toUnmodifiableList());
58+
.filter(not(Method::isSynthetic))//
59+
.map(Method::getName)//
60+
.collect(toUnmodifiableList());
5861

5962
@BeforeEach
6063
void clearResults() {

0 commit comments

Comments
 (0)