2015-07-31 21:15:27 +08:00
|
|
|
@SpringApplicationConfiguration(Application)
|
2014-05-28 17:46:46 +08:00
|
|
|
@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
|
|
|
|
}
|