Fixed the Integrations Tests in spring-data-rest-querydsl

This commit is contained in:
Ali Dehghani
2019-10-30 01:10:19 +03:30
parent 18c6a1a0ab
commit f0a3af9187

View File

@@ -36,17 +36,17 @@ public class IntegrationTest {
@Test public void givenRequestHasBeenMade_whenQueryOverNameAttribute_thenGetJohn() throws Exception {
// Get John
mockMvc.perform(get("/personQuery?name=John")).andExpect(status().isOk()).andExpect(content().contentType(contentType))
mockMvc.perform(get("/users?name=John")).andExpect(status().isOk()).andExpect(content().contentType(contentType))
.andExpect(jsonPath("$", hasSize(1))).andExpect(jsonPath("$[0].name", is("John")))
.andExpect(jsonPath("$[0].address.address", is("Fake Street 1")))
.andExpect(jsonPath("$[0].address.country", is("Fake Country")));
.andExpect(jsonPath("$[0].address.country", is("Spain")));
}
@Test public void givenRequestHasBeenMade_whenQueryOverNameAttribute_thenGetLisa() throws Exception {
// Get Lisa
mockMvc.perform(get("/personQuery?name=Lisa")).andExpect(status().isOk()).andExpect(content().contentType(contentType))
mockMvc.perform(get("/users?name=Lisa")).andExpect(status().isOk()).andExpect(content().contentType(contentType))
.andExpect(jsonPath("$", hasSize(1))).andExpect(jsonPath("$[0].name", is("Lisa")))
.andExpect(jsonPath("$[0].address.address", is("Real Street 1")))
.andExpect(jsonPath("$[0].address.country", is("Real Country")));
.andExpect(jsonPath("$[0].address.country", is("Germany")));
}
}