HomeResource { @GET public List<Event> homepage(@Auth AccessToken token) { return eventDao.homepageEvents(token.getUserId()); } HomeResource(CheckEatDAO checkeatDao, MealDAO mealDao, EventDAO eventDao,NutritionixClient client); @GET List<Event> homepage(@Auth AccessToken token); @GET @Path("/lastweek") NutritionalInfo lastWeekSummary(@Auth AccessToken token); @GET @Path("/lastweek/meals") List<CheckEat> lastWeekCheckEats(@Auth AccessToken token);  }
@Test public void testHomepage() throws Exception { Response res = rule.getJerseyTest() .target("/home") .request(MediaType.APPLICATION_JSON_TYPE) .header("Authorization", "Bearer test") .get(); @SuppressWarnings({ "rawtypes", "unchecked" }) ArrayList<LinkedHashMap> read = mapper.readValue(res.readEntity(String.class), ArrayList.class); assertThat(res.getStatusInfo().getStatusCode()).isEqualTo(200); assertThat(read.size()).isEqualTo(2); assertThat(read.get(0).get("description")).isEqualTo(evt.getDescription()); }