Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
inventory-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ascend
inventory-service
Commits
76cfd59e
Commit
76cfd59e
authored
May 06, 2021
by
Khai Yuan Liew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[AFP-58] Finish DELETE product endpoint and test
parent
79ae60ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
ProductControllerTest.java
...um/ascend/inventory/controller/ProductControllerTest.java
+19
-1
No files found.
src/test/java/com/nisum/ascend/inventory/controller/ProductControllerTest.java
View file @
76cfd59e
...
...
@@ -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..."
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment