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); } }