Skip to content

Commit

Permalink
feat: adds negative test case
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Sep 2, 2023
1 parent 3e665a6 commit 6ddeb0a
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,27 @@ void productsShouldExistsByProductCodes() {
.isEqualTo(Boolean.TRUE);
}

@Test
void productsShouldNotExistsByProductCodes() {
List<String> productCodeList = List.of("P1", "P2", "P3", "P4", "P5");

webTestClient
.get()
.uri(
uriBuilder -> {
uriBuilder.queryParam("productCodes", productCodeList);
uriBuilder.path("/api/catalog/exists");
return uriBuilder.build();
})
.exchange()
.expectStatus()
.isOk()
.expectHeader()
.contentType(MediaType.APPLICATION_JSON)
.expectBody(Boolean.class)
.isEqualTo(Boolean.FALSE);
}

@Test
void shouldCreateNewProduct() {
ProductDto productDto = new ProductDto("code 4", "name 4", "description 4", 19.0);
Expand Down

0 comments on commit 6ddeb0a

Please sign in to comment.