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.
22 lines
391 B
Groovy
22 lines
391 B
Groovy
8 years ago
|
package com.example
|
||
|
|
||
|
@SpringBootApplication
|
||
|
@SpringBootTest(classes=RestTests, webEnvironment=WebEnvironment.RANDOM_PORT)
|
||
11 years ago
|
class RestTests {
|
||
|
|
||
8 years ago
|
@Autowired
|
||
|
TestRestTemplate testRestTemplate;
|
||
11 years ago
|
|
||
|
@Test
|
||
|
void testHome() {
|
||
8 years ago
|
assertEquals('Hello', testRestTemplate.getForObject('/', String))
|
||
11 years ago
|
}
|
||
|
|
||
|
@RestController
|
||
|
static class Application {
|
||
|
@RequestMapping('/')
|
||
|
String hello() { 'Hello' }
|
||
|
}
|
||
8 years ago
|
|
||
11 years ago
|
}
|