From 1e83f38b0e2d04791e821ffd24bee9392cb6a034 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