@@ -0,0 +1,1755 @@
+package com.danchu.momuck.controller;%0A%0Aimport static org.hamcrest.Matchers.hasKey;%0Aimport static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;%0Aimport static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;%0Aimport static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;%0Aimport static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.http.MediaType;%0Aimport org.springframework.test.context.ContextConfiguration;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0Aimport org.springframework.test.context.web.WebAppConfiguration;%0Aimport org.springframework.test.web.servlet.MockMvc;%0Aimport org.springframework.test.web.servlet.setup.MockMvcBuilders;%0Aimport org.springframework.web.context.WebApplicationContext;%0A%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@WebAppConfiguration%0A@ContextConfiguration(locations = %7B %22classpath:/root-context.xml%22, %22classpath:servlet-context.xml%22 %7D)%0Apublic class FoodControllerTest %7B%0A%0A%09@Autowired%0A%09private WebApplicationContext wac;%0A%0A%09private MockMvc mockMvc;%0A%0A%09@Before%0A%09public void setup() %7B%0A%09%09this.mockMvc = MockMvcBuilders.webAppContextSetup(wac).build();%0A%09%7D%0A%0A%09@Test%0A%09public void getFoodList() throws Exception %7B%0A%0A%09%09this.mockMvc.perform(get(%22/foods%22).contentType(MediaType.APPLICATION_JSON).param(%22page%22, %221%22))%0A%09%09%09%09.andExpect(status().isOk())%0A%09%09%09%09.andExpect(content().contentType(%22application/json;charset=UTF-8%22))%0A%09%09%09%09.andExpect(jsonPath(%22$%22, hasKey(%22code%22)))%0A%09%09%09%09.andExpect(jsonPath(%22$.code%22).value(%22200%22))%0A%09%09%09%09.andReturn();%0A%09%7D%0A%7D%0A

Add FoodControllerTest