Commit d2d78b83 authored by John Lam's avatar John Lam

fixed exception and test exception

parent 077d16b0
package com.nisum.ascend.inventory.exception; package com.nisum.ascend.inventory.exception;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(value = HttpStatus.NOT_FOUND)
public class ResourceNotFoundException extends Exception{ public class ResourceNotFoundException extends Exception{
HttpStatus status; HttpStatus status;
......
...@@ -32,6 +32,12 @@ class ProductControllerTest { ...@@ -32,6 +32,12 @@ class ProductControllerTest {
@Autowired @Autowired
private WebTestClient client; private WebTestClient client;
@BeforeEach
public void setup(){
}
@Test @Test
void testProductInvalidSkuNotFound() { void testProductInvalidSkuNotFound() {
client client
...@@ -39,7 +45,7 @@ class ProductControllerTest { ...@@ -39,7 +45,7 @@ class ProductControllerTest {
.uri("/products/".concat("{sku}"), "invalid") .uri("/products/".concat("{sku}"), "invalid")
.exchange() .exchange()
.expectStatus() .expectStatus()
.is5xxServerError(); .isNotFound();
} }
@Test @Test
......
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