Commit 76cfd59e authored by Khai Yuan ​Liew's avatar Khai Yuan ​Liew

[AFP-58] Finish DELETE product endpoint and test

parent 79ae60ae
......@@ -95,13 +95,31 @@ class ProductControllerTest {
});
}
/*
If you want to do this test, make sure to insert the following in MongoDB Atlas:
,
"sku": "SH=1123",
"upc":"3d2dsd9cm",
"productName":"Blue Sweater",
"productDescription":"A Nice red sweater",
"price":23.99,
"availableStock":45,
"blockedStock":0,
"productImageUrl":"",
"brand":"SweatCo",
"category":"Sweatshirts"
*/
@Test
public void testDeleteProduct(){
webTestClient.delete().uri("/products".concat("/{sku}"),"100000")
String sku = "SH=1123";
webTestClient.delete().uri("/api/products".concat("/{sku}"),sku)
.accept(MediaType.valueOf(MediaType.APPLICATION_JSON_VALUE))
.exchange()
.expectStatus().isOk()
.expectBody(Void.class);
System.out.println("Deletion Successful. Ending 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