You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
399 B
Groovy
20 lines
399 B
Groovy
11 years ago
|
@SpringApplicationConfiguration(classes=Application)
|
||
|
@IntegrationTest('server.port:0')
|
||
|
@WebAppConfiguration
|
||
|
class RestTests {
|
||
|
|
||
|
@Value('${local.server.port}')
|
||
|
int port
|
||
|
|
||
|
@Test
|
||
|
void testHome() {
|
||
|
assertEquals('Hello', new TestRestTemplate().getForObject('http://localhost:' + port, String))
|
||
|
}
|
||
|
|
||
|
@RestController
|
||
|
static class Application {
|
||
|
@RequestMapping('/')
|
||
|
String hello() { 'Hello' }
|
||
|
}
|
||
|
}
|