Skip to content

Commit

Permalink
fixes Issue with Junit
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Oct 4, 2023
1 parent 6f8c490 commit 83dd652
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static com.example.hibernatecache.utils.AppConstants.PROFILE_TEST;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.Matchers.hasSize;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.doNothing;
Expand Down Expand Up @@ -114,10 +115,13 @@ void shouldReturn400WhenCreateNewCustomerWithoutFirstName() throws Exception {
.andExpect(status().isBadRequest())
.andExpect(header().string("Content-Type", is("application/problem+json")))
.andExpect(jsonPath("$.type", is("about:blank")))
.andExpect(jsonPath("$.title", is("Bad Request")))
.andExpect(jsonPath("$.title", is("Constraint Violation")))
.andExpect(jsonPath("$.status", is(400)))
.andExpect(jsonPath("$.detail", is("Invalid request content.")))
.andExpect(jsonPath("$.instance", is("/api/customers")))
.andExpect(jsonPath("$.violations", hasSize(1)))
.andExpect(jsonPath("$.violations[0].field", is("firstName")))
.andExpect(jsonPath("$.violations[0].message", is("FirstName cannot be empty")))
.andReturn();
}

Expand Down

0 comments on commit 83dd652

Please sign in to comment.