From: Gustavo Martin Morcuende Date: Sun, 3 Jan 2016 00:17:13 +0000 (+0100) Subject: Spring REST: integration tests X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=13cc87dc83a7f76423eed3c85269ee503b40f6bd;p=SpringWebServicesForFun%2F.git Spring REST: integration tests --- diff --git a/SpringJava/REST/src/test/java/de/spring/webservices/rest/CarControllerIntegrationTest.java b/SpringJava/REST/src/test/java/de/spring/webservices/rest/CarControllerIntegrationTest.java index a19ecc3..3ed613c 100644 --- a/SpringJava/REST/src/test/java/de/spring/webservices/rest/CarControllerIntegrationTest.java +++ b/SpringJava/REST/src/test/java/de/spring/webservices/rest/CarControllerIntegrationTest.java @@ -50,16 +50,16 @@ public class CarControllerIntegrationTest { .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)); } -// @Test -// public void testWhenGetOneCarThenRetrieveJsonValue() throws Exception { -// mockMvc.perform(get("/api/cars/{id}", 1L) -// .accept(MediaType.APPLICATION_JSON_UTF8_VALUE)) -// -// .andExpect(status().isOk()) -// .andExpect(jsonPath("id", any(Integer.class))) -// .andExpect(jsonPath("content", is("Car: 1"))) -// .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)); -// } + @Test + public void testWhenGetOneCarThenRetrieveJsonValue() throws Exception { + mockMvc.perform(get("/api/cars/{id}", 1L) + .accept(MediaType.APPLICATION_JSON_UTF8_VALUE)) + + .andExpect(status().isOk()) + .andExpect(jsonPath("id", any(Integer.class))) + .andExpect(jsonPath("content", is("Car: 1"))) + .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)); + } @Test public void testWhenCreateNewCarThenRetrieveJsonValue() throws Exception {