mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-05-02 19:30:23 +01:00
f33c7bc27c
See gh-24628
22 lines
390 B
Groovy
22 lines
390 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' }
|
|
}
|
|
|
|
}
|