스프링부트 테스트
public class HelloApiTest { @Test void helloApi(){ // http localhost:8080/hello?name=Spring TestRestTemplate rest = new TestRestTemplate(); ResponseEntity res = rest.getForEntity("http://localhost:8080/hello?name={name}", String.class, "Spring"); // status 200 Assertions.assertThat(res.getStatusCode()).isEqualTo(HttpStatus.OK); // header(content-type) text/plain Assertions.assertThat(res.getHead..
2023.02.06