mirror of
https://gitee.com/dcren/initializr.git
synced 2025-09-19 10:08:22 +08:00
20 lines
458 B
Groovy
20 lines
458 B
Groovy
![]() |
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"'))
|
||
|
}
|
||
|
|
||
|
}
|