MenuResource { @GET @Path("/{id}") public Menu menuById(@PathParam("id") Long id){ return menuDao.getMenuById(id); } MenuResource(MenuDAO menuDao, MealDAO mealDao, UserDAO userDao); @GET @Path("/{id}") Menu menuById(@PathParam("id") Long id); @GET @Path("/{id}/meals") List<Meal> mealsByMenu(@PathParam("id") Long id); @POST Response createMenu(@Auth AccessToken token, @Valid Menu menu);  }
@Test public void testMenuById() throws Exception { Response res = rule.getJerseyTest() .target("/menu/1") .request(MediaType.APPLICATION_JSON_TYPE) .get(); @SuppressWarnings("rawtypes") LinkedHashMap read = mapper.readValue(res.readEntity(String.class), LinkedHashMap.class); assertThat(res.getStatusInfo().getStatusCode()).isEqualTo(200); assertThat(read.get("name")).isEqualTo(menu.getName()); }