From 13cc87dc83a7f76423eed3c85269ee503b40f6bd Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Sun, 3 Jan 2016 01:17:13 +0100 Subject: [PATCH] Spring REST: integration tests --- .../rest/CarControllerIntegrationTest.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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 { -- 2.1.4