Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 78feac0

Browse files
committed
Test mvc deleteProduct.
1 parent 1c696c0 commit 78feac0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

‎src/test/java/com/nihat/springwebfluxdemo/controllers/mvc/ProductControllerTest.java‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,19 @@ void testUpdateProductNotFound() {
151151
.expectStatus().isNotFound();
152152
}
153153

154+
@Test
155+
@Order(99)
156+
void testDeleteProduct() {
157+
// Given
158+
String productIdToDelete = "1"; // Existing product ID
159+
160+
// When
161+
webTestClient.delete().uri(ProductController.PRODUCT_ID_URL, productIdToDelete)
162+
.exchange()
163+
// Then
164+
.expectStatus().isNoContent();
165+
}
166+
154167
private ProductDTO getSavedTestProduct() {
155168
return productService.getAllProducts().next().block();
156169
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /