Commit 79ae60ae authored by Khai Yuan ​Liew's avatar Khai Yuan ​Liew

[AFP-58] Add DELETE controller test

parent a7b9493d
...@@ -16,7 +16,6 @@ public class ProductService { ...@@ -16,7 +16,6 @@ public class ProductService {
@Autowired @Autowired
ProductRepository productRepository; ProductRepository productRepository;
public Mono<Product> removeProductBySku(String sku) { public Mono<Product> removeProductBySku(String sku) {
return productRepository return productRepository
.findBySku(sku) .findBySku(sku)
......
...@@ -95,5 +95,14 @@ class ProductControllerTest { ...@@ -95,5 +95,14 @@ class ProductControllerTest {
}); });
} }
@Test
public void testDeleteProduct(){
webTestClient.delete().uri("/products".concat("/{sku}"),"100000")
.accept(MediaType.valueOf(MediaType.APPLICATION_JSON_VALUE))
.exchange()
.expectStatus().isOk()
.expectBody(Void.class);
}
} }
\ No newline at end of file
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