Spring Boot - Testing Spring Boot Applications
Given this test class snippet:
What will be printed if the /hello endpoint returns "Hello World"?
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class MyTest {
@Autowired
private TestRestTemplate restTemplate;
@Test
void testHello() {
String body = restTemplate.getForObject("/hello", String.class);
System.out.println(body);
}
}What will be printed if the /hello endpoint returns "Hello World"?
