Skip to content

Commit de7d50d

Browse files
committed
Redeclare @⁠TestMethodOrder on @⁠Nested test class
Thanks to the new Discovery Issue Reporting mechanism introduced in JUnit 5.13, I became aware of the fact that the @⁠Order annotations in NestedAfterTestClassSqlScriptsTests were being silently ignored. To address that, this commit redeclares @⁠TestMethodOrder on @⁠Nested test class.
1 parent 5752585 commit de7d50d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-test/src/test/java/org/springframework/test/context/jdbc/AfterTestClassSqlScriptsTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -72,6 +72,7 @@ void databaseIsNotWipedBetweenTests() {
7272
}
7373

7474
@Nested
75+
@TestMethodOrder(OrderAnnotation.class)
7576
@Sql(scripts = "recreate-schema.sql", executionPhase = BEFORE_TEST_CLASS)
7677
@Sql(scripts = "drop-schema.sql", executionPhase = AFTER_TEST_CLASS)
7778
class NestedAfterTestClassSqlScriptsTests {

0 commit comments

Comments
 (0)