This was discovered as part of #49854.
This fails:
@WebMvcTest
class ExampleTests {
@Autowired
MockMvcTester mvc;
@Nested
@Import(Blank.class)
class NestedExample {
@Test
void contextLoads() {
}
}
static class Blank {
}
}
@SpringBootTest is also affected:
@SpringBootTest
@AutoConfigureMockMvc
class ExampleTests {
@Autowired
MockMvcTester mvc;
@Nested
@Import(Blank.class)
class NestedExample {
@Test
void contextLoads() {
}
}
static class Blank {
}
}
In either case, the problem doesn't occur if @Import(Blank.class) is removed or if it's moved out onto the containing class.
This was discovered as part of #49854.
This fails:
@SpringBootTestis also affected:In either case, the problem doesn't occur if
@Import(Blank.class)is removed or if it's moved out onto the containing class.