diff --git a/src/test/java/org/openrewrite/java/testing/assertj/AssertJBestPracticesTest.java b/src/test/java/org/openrewrite/java/testing/assertj/AssertJBestPracticesTest.java index 8d229935a..43cbfc32e 100644 --- a/src/test/java/org/openrewrite/java/testing/assertj/AssertJBestPracticesTest.java +++ b/src/test/java/org/openrewrite/java/testing/assertj/AssertJBestPracticesTest.java @@ -15,6 +15,7 @@ */ package org.openrewrite.java.testing.assertj; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -69,6 +70,26 @@ void test() { ); } + @Test + @Issue("https://github.com/openrewrite/rewrite-testing-frameworks/issues/664") + void assertionsForClassTypesIsNotRemovedByAssertionsImport() { + rewriteRun( + // language=java + java( + """ + import java.util.Map; + import static org.assertj.core.api.AssertionsForClassTypes.assertThat; + + class Test { + void test() { + assertThat(Map.of("a", 1).entrySet()).hasNoNullFieldsOrProperties(); + } + } + """ + ) + ); + } + @Test @Issue("https://github.com/openrewrite/rewrite-testing-frameworks/issues/398") void sizeIsEqualToZeroToIsEmpty() {