mirror of
https://gitee.com/dcren/initializr.git
synced 2026-09-19 06:17:42 +08:00
Add integration test
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package test
|
||||
|
||||
@Grab("spring-boot-starter-test")
|
||||
|
||||
@SpringApplicationConfiguration(classes=app.MainController)
|
||||
@WebAppConfiguration
|
||||
@IntegrationTest('server.port:0')
|
||||
@DirtiesContext
|
||||
class IntegrationTests {
|
||||
|
||||
@Value('${local.server.port}')
|
||||
int port
|
||||
|
||||
@Test
|
||||
void testHome() {
|
||||
String body = new TestRestTemplate().getForObject('http://localhost:' + port, String)
|
||||
assertTrue('Wrong body:\n' + body, body.contains('action="/starter.zip"'))
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user