Commit 4b8d1bfb authored by John Lam's avatar John Lam

pull from dev and fix merge conflicts

parent 814be431
......@@ -26,6 +26,7 @@ public class ProductController {
Mono<ProductDto> monoProd = productService.getProductBySku(sku);
HttpStatus status = monoProd != null ? HttpStatus.OK : HttpStatus.NOT_FOUND;
return new ResponseEntity<>(monoProd, status);
}
@GetMapping()
public ResponseEntity<Flux<ProductDto>> getAllProducts() {
......
......@@ -44,7 +44,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
class ProductControllerTest {
@Autowired
private WebTestClient client;
private WebTestClient webTestClient;
@BeforeEach
......@@ -54,7 +54,7 @@ class ProductControllerTest {
@Test
void testProductInvalidSkuNotFound() {
client
webTestClient
.get()
.uri("/api/products/".concat("{sku}"), "invalid")
.exchange()
......@@ -66,7 +66,7 @@ class ProductControllerTest {
void testProductBySkuFound() {
String sku = "000001";
client.get()
webTestClient.get()
.uri("/api/products/".concat("/{sku}"), sku)
.exchange()
.expectStatus()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment