Skip to content

Commit 968adce

Browse files
committed
Adjust expectations now that STATIC_IMPORT_ALWAYS works
1 parent 81d02b8 commit 968adce

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/main/java/org/openrewrite/java/testing/cleanup/AssertLiteralBooleanToFail.java

-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ void assertTrueBefore(String message) {
4040
}
4141

4242
@AfterTemplate
43-
// This annotation does not get taken into account
44-
// resulting in Assertions.fail(message) being outputted
4543
@UseImportPolicy(value = STATIC_IMPORT_ALWAYS)
4644
void after(String message) {
4745
fail(message);

src/test/java/org/openrewrite/java/testing/cleanup/AssertLiteralBooleanToFailTest.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ void test() {
5252
}
5353
""",
5454
"""
55-
import org.junit.jupiter.api.Assertions;
55+
import static org.junit.jupiter.api.Assertions.fail;
5656
5757
public class Test {
5858
void test() {
59-
Assertions.fail("assert false true");
60-
Assertions.fail("assert true false");
59+
fail("assert false true");
60+
fail("assert true false");
6161
}
6262
}
6363
"""
@@ -82,12 +82,12 @@ void test() {
8282
}
8383
""",
8484
"""
85-
import org.junit.jupiter.api.Assertions;
85+
import static org.junit.jupiter.api.Assertions.fail;
8686
8787
public class Test {
8888
void test() {
89-
Assertions.fail("assert false true");
90-
Assertions.fail("assert true false");
89+
fail("assert false true");
90+
fail("assert true false");
9191
}
9292
}
9393
"""

0 commit comments

Comments
 (0)