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.
spring-boot/spring-boot-project/spring-boot-cli/test-samples/integration_auto.groovy

22 lines
391 B
Groovy

package com.example
@SpringBootApplication
@SpringBootTest(classes=RestTests, webEnvironment=WebEnvironment.RANDOM_PORT)
class RestTests {
@Autowired
TestRestTemplate testRestTemplate;
@Test
void testHome() {
assertEquals('Hello', testRestTemplate.getForObject('/', String))
}
@RestController
static class Application {
@RequestMapping('/')
String hello() { 'Hello' }
}
}