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 e840a2d

Browse files
committed
test delete product.
1 parent 919db7c commit e840a2d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

‎src/test/java/com/nihat/springwebfluxdemo/controllers/fn/ProductEndpointTest.java‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,21 @@ void testUpdateProductNotFound() {
150150
.expectStatus().isNotFound();
151151
}
152152

153+
@Test
154+
@Order(99)
155+
void testDeleteProduct() {
156+
// Given
157+
String productIdToDelete = "1"; // Existing product ID
158+
159+
// When
160+
webTestClient.delete().uri(ProductRouterConfig.PRODUCT_ID_PATH, productIdToDelete)
161+
.exchange()
162+
// Then
163+
.expectStatus().isNoContent();
164+
}
153165

154166

155-
private ProductDTO getSavedTestProduct() {
167+
private ProductDTO getSavedTestProduct() {
156168
return productService.getAllProducts().next().block();
157169
}
158170

0 commit comments

Comments
(0)

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