Spring Boot
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

21 lines
390 B

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' }
}
}