| | |
| | | <parent> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-parent</artifactId> |
| | | <version>2.7.3</version> |
| | | <version>3.1.3</version> |
| | | <relativePath/> <!-- lookup parent from repository --> |
| | | </parent> |
| | | <groupId>de.gedoplan.seminar.sbt</groupId> |
| | |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.boot.test.web.server.LocalServerPort; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.reactive.function.client.WebClient; |
| | |
| | | .toEntity(String.class) |
| | | .block(); |
| | | |
| | | System.out.printf("Response status: %03d %s\n", response.getStatusCode().value(), response.getStatusCode().getReasonPhrase()); |
| | | String message = switch (response.getStatusCode()) { |
| | | HttpStatus httpStatus = HttpStatus.resolve(response.getStatusCode().value()); |
| | | System.out.printf("Response status: %03d %s\n", httpStatus.value(), httpStatus.getReasonPhrase()); |
| | | String message = switch (httpStatus) { |
| | | case CREATED -> "URI: %s\n".formatted(response.getHeaders().getLocation()); |
| | | case INTERNAL_SERVER_ERROR -> response.getBody(); |
| | | default -> ""; |