I can't reload my spring application after each test into my nested classes:
/*...*/
@DirtiesContext( classMode = AFTER_EACH_TEST_METHOD )
public class MyTestClass {
@Nested
class MyNestedClass_1 {
@Test
void test_1() {
/*...*/
}
@Test
void test_2() {
/*...*/
}
}
@Nested
class MyNestedClass_2 {
/*..*/
}
}
Whereas, it works very well without nested class:
/*...*/
@DirtiesContext( classMode = AFTER_EACH_TEST_METHOD )
public class MyTestClass {
@Test
void test_1() {
/*...*/
}
@Test
void test_2() {
/*...*/
}
}
Does anybody have any idea why it doesn't work?