Skip to content

Commit

Permalink
[660] Use the correct implementation of the MethodOrderer for the @Te…
Browse files Browse the repository at this point in the history
…stMethodOrder annotation.

Signed-off-by: James R. Perkins <[email protected]>
  • Loading branch information
jamezp committed Jan 3, 2025
1 parent 1e78caa commit e811417
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
Expand Down

0 comments on commit e811417

Please sign in to comment.