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 { ...@@ -26,6 +26,7 @@ public class ProductController {
Mono<ProductDto> monoProd = productService.getProductBySku(sku); Mono<ProductDto> monoProd = productService.getProductBySku(sku);
HttpStatus status = monoProd != null ? HttpStatus.OK : HttpStatus.NOT_FOUND; HttpStatus status = monoProd != null ? HttpStatus.OK : HttpStatus.NOT_FOUND;
return new ResponseEntity<>(monoProd, status); return new ResponseEntity<>(monoProd, status);
}
@GetMapping() @GetMapping()
public ResponseEntity<Flux<ProductDto>> getAllProducts() { public ResponseEntity<Flux<ProductDto>> getAllProducts() {
......
...@@ -44,7 +44,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; ...@@ -44,7 +44,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
class ProductControllerTest { class ProductControllerTest {
@Autowired @Autowired
private WebTestClient client; private WebTestClient webTestClient;
@BeforeEach @BeforeEach
...@@ -54,7 +54,7 @@ class ProductControllerTest { ...@@ -54,7 +54,7 @@ class ProductControllerTest {
@Test @Test
void testProductInvalidSkuNotFound() { void testProductInvalidSkuNotFound() {
client webTestClient
.get() .get()
.uri("/api/products/".concat("{sku}"), "invalid") .uri("/api/products/".concat("{sku}"), "invalid")
.exchange() .exchange()
...@@ -66,7 +66,7 @@ class ProductControllerTest { ...@@ -66,7 +66,7 @@ class ProductControllerTest {
void testProductBySkuFound() { void testProductBySkuFound() {
String sku = "000001"; String sku = "000001";
client.get() webTestClient.get()
.uri("/api/products/".concat("/{sku}"), sku) .uri("/api/products/".concat("/{sku}"), sku)
.exchange() .exchange()
.expectStatus() .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