-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Closed
Description
I found this test passes:
@SpringBootTest(classes = RestTemplate.class)
class MyTest {
@Autowired
RestTemplate restTemplate;
@Test
void check() {
assertThat(restTemplate).isNotNull();
}
}The underlying reason is same as what I reported here: spring-projects/spring-framework#23638
Since spring-boot is more opinionated, I think it makes sense to restrict @SpringBootTest#classes for only @Configuration classes.
SpringBootTestContextBootstrapper may filter out non @Configuration classes or throw exception when it constructs MergedContextConfiguration.
Metadata
Metadata
Assignees
Labels
type: documentationA documentation updateA documentation update