Spring REST: integration tests
authorGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 3 Jan 2016 00:17:13 +0000 (01:17 +0100)
committerGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 3 Jan 2016 00:17:13 +0000 (01:17 +0100)
SpringJava/REST/src/test/java/de/spring/webservices/rest/CarControllerIntegrationTest.java

index a19ecc3..3ed613c 100644 (file)
@@ -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 {