BAEL-20884 Fix Spring Hateos integration test

This commit is contained in:
mikr 2020-01-21 10:44:38 +01:00
parent 65b8a95943
commit 68d1504372

View File

@ -70,7 +70,7 @@ public class CustomerControllerIntegrationTest {
this.mvc.perform(get("/customers/" + DEFAULT_CUSTOMER_ID + "/orders").accept(MediaTypes.HAL_JSON_VALUE)) this.mvc.perform(get("/customers/" + DEFAULT_CUSTOMER_ID + "/orders").accept(MediaTypes.HAL_JSON_VALUE))
.andExpect(status().isOk()) .andExpect(status().isOk())
.andExpect(jsonPath("$._embedded.orderList[0]._links.self.href", .andExpect(jsonPath("$._embedded.orders[0]._links.self.href",
is("http://localhost/customers/customer1/order1"))) is("http://localhost/customers/customer1/order1")))
.andExpect(jsonPath("$._links.self.href", is("http://localhost/customers/customer1/orders"))); .andExpect(jsonPath("$._links.self.href", is("http://localhost/customers/customer1/orders")));
} }
@ -89,8 +89,8 @@ public class CustomerControllerIntegrationTest {
this.mvc.perform(get("/customers/").accept(MediaTypes.HAL_JSON_VALUE)) this.mvc.perform(get("/customers/").accept(MediaTypes.HAL_JSON_VALUE))
.andExpect(status().isOk()) .andExpect(status().isOk())
.andExpect( .andExpect(
jsonPath("$._embedded.customerList[0]._links.self.href", is("http://localhost/customers/customer1"))) jsonPath("$._embedded.customers[0]._links.self.href", is("http://localhost/customers/customer1")))
.andExpect(jsonPath("$._embedded.customerList[0]._links.allOrders.href", .andExpect(jsonPath("$._embedded.customers[0]._links.allOrders.href",
is("http://localhost/customers/customer1/orders"))) is("http://localhost/customers/customer1/orders")))
.andExpect(jsonPath("$._links.self.href", is("http://localhost/customers"))); .andExpect(jsonPath("$._links.self.href", is("http://localhost/customers")));
} }