Spring Boot - Testing Spring Boot Applications
Given the following test class snippet, what will be the output when running the test?
Assuming the
\@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
class MyIntegrationTest {
\@Autowired
private TestRestTemplate restTemplate;
\@Test
void testHelloEndpoint() {
String response = restTemplate.getForObject("/hello", String.class);
System.out.println(response);
}
}Assuming the
/hello endpoint returns "Hello, Spring!".