From a4a0e111bc084308556a8e9d2b76a37991b614ac Mon Sep 17 00:00:00 2001 From: "James R. Perkins" Date: Fri, 3 Jan 2025 22:54:15 -0800 Subject: [PATCH] [660] Use the correct implementation of the MethodOrderer for the @TestMethodOrder annotation. (#661) Signed-off-by: James R. Perkins --- .../arquillian/ReplaceArquillianInSequenceAnnotation.java | 2 +- .../arquillian/ArquillianJUnit4ToArquillianJunit5Test.java | 2 +- .../arquillian/ReplaceArquillianInSequenceAnnotationTest.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/openrewrite/java/testing/arquillian/ReplaceArquillianInSequenceAnnotation.java b/src/main/java/org/openrewrite/java/testing/arquillian/ReplaceArquillianInSequenceAnnotation.java index 5dd34af5c..f83a6f912 100644 --- a/src/main/java/org/openrewrite/java/testing/arquillian/ReplaceArquillianInSequenceAnnotation.java +++ b/src/main/java/org/openrewrite/java/testing/arquillian/ReplaceArquillianInSequenceAnnotation.java @@ -69,7 +69,7 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, Ex !service(AnnotationService.class).matches(updateCursor(cd), TEST_METHOD_ORDER_MATCHER)) { maybeAddImport(METHOD_ORDERER); maybeAddImport(TEST_METHOD_ORDER); - return JavaTemplate.builder("@TestMethodOrder(MethodOrderer.class)") + return JavaTemplate.builder("@TestMethodOrder(MethodOrderer.OrderAnnotation.class)") .imports(METHOD_ORDERER, TEST_METHOD_ORDER) .javaParser(JavaParser.fromJavaVersion().classpathFromResources(ctx, "junit-jupiter-api-5")) .build() diff --git a/src/test/java/org/openrewrite/java/testing/arquillian/ArquillianJUnit4ToArquillianJunit5Test.java b/src/test/java/org/openrewrite/java/testing/arquillian/ArquillianJUnit4ToArquillianJunit5Test.java index 81134ce80..cc9a0a706 100644 --- a/src/test/java/org/openrewrite/java/testing/arquillian/ArquillianJUnit4ToArquillianJunit5Test.java +++ b/src/test/java/org/openrewrite/java/testing/arquillian/ArquillianJUnit4ToArquillianJunit5Test.java @@ -65,7 +65,7 @@ void convert() { org.jboss.arquillian.junit5 arquillian-junit5-container - 1.9.1.Final + 1.9.2.Final test diff --git a/src/test/java/org/openrewrite/java/testing/arquillian/ReplaceArquillianInSequenceAnnotationTest.java b/src/test/java/org/openrewrite/java/testing/arquillian/ReplaceArquillianInSequenceAnnotationTest.java index ee41cac14..cf5ae2b9a 100644 --- a/src/test/java/org/openrewrite/java/testing/arquillian/ReplaceArquillianInSequenceAnnotationTest.java +++ b/src/test/java/org/openrewrite/java/testing/arquillian/ReplaceArquillianInSequenceAnnotationTest.java @@ -54,7 +54,7 @@ void first() {} import org.junit.jupiter.api.Order; import org.junit.jupiter.api.TestMethodOrder; - @TestMethodOrder(MethodOrderer.class) + @TestMethodOrder(MethodOrderer.OrderAnnotation.class) class A { @Order(2) void second() {}