Ejemplo n.º 1
0
 @Test
 public void testGetAll() throws Exception {
   mockMvc
       .perform(get(REST_URL).contentType(MediaType.APPLICATION_JSON).with(userHttpBasic(USER)))
       .andExpect(status().isOk())
       .andDo(print())
       .andExpect(content().contentType(MediaType.APPLICATION_JSON))
       .andExpect(
           MATCHER_WITH_EXCEED.contentListMatcher(
               UserMealsUtil.getWithExceeded(USER_MEALS, USER.getCaloriesPerDay())));
 }
Ejemplo n.º 2
0
 @Test
 public void testFilterAll() throws Exception {
   mockMvc
       .perform(get(REST_URL + "filter?startDate=&endTime=").with(userHttpBasic(USER)))
       .andExpect(status().isOk())
       .andDo(print())
       .andExpect(
           MATCHER_WITH_EXCEED.contentListMatcher(
               UserMealsUtil.getWithExceeded(
                   Arrays.asList(MEAL6, MEAL5, MEAL4, MEAL3, MEAL2, MEAL1),
                   USER.getCaloriesPerDay())));
 }