
JUnit tests can now be @SpringApplicationConfiguration and @IntegrationTest without any explicit imports. Also makes @RunWith(SpringJUnit4ClassRunner) optional. Fixes gh-969
24 lines
350 B
Groovy
24 lines
350 B
Groovy
@SpringApplicationConfiguration(classes=Application)
|
|
@IntegrationTest
|
|
class BookTests {
|
|
@Autowired
|
|
Book book
|
|
@Test
|
|
void testBooks() {
|
|
assertEquals("Tom Clancy", book.author)
|
|
}
|
|
}
|
|
|
|
@Configuration
|
|
class Application {
|
|
@Bean
|
|
Book book() {
|
|
new Book(author: "Tom Clancy", title: "Threat Vector")
|
|
}
|
|
}
|
|
|
|
class Book {
|
|
String author
|
|
String title
|
|
}
|