From bbe75f3580c545dc4a34f762918974bc145cdb38 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 14 Jan 2019 13:32:13 +0100 Subject: [PATCH] Don't modify TestPlan Although `TestPlan` exposes an `add(TestIdentifier)` method, it was only ever intended for internal use by JUnit's `DefaultLauncher` which already adds dynamic test identifiers to the `TestPlan`. The JUnit team is going to make the `add()` throw an exception on modifications from listeners. Thus, this commit removes the unnecessary call. --- .../src/com/intellij/junit5/JUnit5TestExecutionListener.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/plugins/junit5_rt/src/com/intellij/junit5/JUnit5TestExecutionListener.java b/plugins/junit5_rt/src/com/intellij/junit5/JUnit5TestExecutionListener.java index ca77042331bc..6376b3a00218 100644 --- a/plugins/junit5_rt/src/com/intellij/junit5/JUnit5TestExecutionListener.java +++ b/plugins/junit5_rt/src/com/intellij/junit5/JUnit5TestExecutionListener.java @@ -164,11 +164,6 @@ public class JUnit5TestExecutionListener implements TestExecutionListener { } } - @Override - public void dynamicTestRegistered(TestIdentifier testIdentifier) { - myTestPlan.add(testIdentifier); - } - @Override public void executionFinished(TestIdentifier testIdentifier, TestExecutionResult testExecutionResult) { final TestExecutionResult.Status status = testExecutionResult.getStatus();