From 0f7fc95a5a91e904b5205965aea6702899b0719b Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Wed, 1 May 2024 20:15:04 +0200 Subject: [PATCH] Explicitly remove org.junit.jupiter.api.Assertions.fail import --- .../openrewrite/java/testing/assertj/JUnitFailToAssertJFail.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/openrewrite/java/testing/assertj/JUnitFailToAssertJFail.java b/src/main/java/org/openrewrite/java/testing/assertj/JUnitFailToAssertJFail.java index d2f1e7118..b93ee3c9e 100644 --- a/src/main/java/org/openrewrite/java/testing/assertj/JUnitFailToAssertJFail.java +++ b/src/main/java/org/openrewrite/java/testing/assertj/JUnitFailToAssertJFail.java @@ -149,6 +149,7 @@ public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, Execu ); //Make sure there is a static import for "org.assertj.core.api.Assertions.assertThat" (even if not referenced) maybeAddImport("org.assertj.core.api.Assertions", "fail", false); + maybeRemoveImport("org.junit.jupiter.api.Assertions.fail"); return super.visitMethodInvocation(method, ctx); } }