Commit 48d05f8a authored by Sumaiyya Burney's avatar Sumaiyya Burney

Updates test

parent 0a90ae18
...@@ -130,13 +130,31 @@ class PromotionsControllerTest { ...@@ -130,13 +130,31 @@ class PromotionsControllerTest {
@Test @Test
void deletePromotion(){ void deletePromotion(){
String promoId = "asd123"; Promotion promo = new Promotion("deleteTest", "AFP-1", 0.33f, 3);
webTestClient.get()
.uri("/api/promos".concat("/{promoId}"), promo.getPromotionId())
.exchange()
.expectStatus().isNotFound();
webTestClient.post()
.uri("/api/promos")
.contentType(MediaType.valueOf(MediaType.APPLICATION_JSON_VALUE))
.body(Mono.just(promo),Promotion.class)
.exchange()
.expectStatus().isOk()
.expectBody(Promotion.class);
webTestClient.delete() webTestClient.delete()
.uri("/api/promos".concat("/{promoId}"),promoId) .uri("/api/promos".concat("/{promoId}"),promo.getPromotionId())
.accept(MediaType.valueOf(MediaType.APPLICATION_JSON_VALUE)) .accept(MediaType.valueOf(MediaType.APPLICATION_JSON_VALUE))
.exchange() .exchange()
.expectStatus().isOk() .expectStatus().isOk()
.expectBody(Void.class); .expectBody(Void.class);
webTestClient.get()
.uri("/api/promos".concat("/{promoId}"), promo.getPromotionId())
.exchange()
.expectStatus().isNotFound();
} }
......
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