I need to write an integration test in Spring where trigger the /hello endpoint. The test should call the endpoint and verify if the response is "hello". how to write this test?
@RestController
@EnableAutoConfiguration public class SpringbootapplicationApplication {
@RequestMapping(method = RequestMethod.GET, value="/Hello")
@ResponseBody
public String getname() {
return "Hello!";
}
public static void main(String[] args) {
SpringApplication.run(SpringbootapplicationApplication.class, args);
}
Aucun commentaire:
Enregistrer un commentaire