MealResource { @GET @Path("/search/{query}") public List<Meal> basicSearch(@PathParam("query") String query) { return mealDao.basicSearch(query); } MealResource(MealDAO mealDao, CommentDAO commentDao, CheckEatDAO checkeatDao, UserDAO userDao, TagDAO tagDao, RatingDAO ratingDao, NutritionixClient client); @GET @Path("/{id}") Meal getMealById(@PathParam("id") Long id); @POST Response createMeal(@Auth AccessToken token, @Valid Meal meal); @POST @Path("/update") Response updateMeal(@Auth AccessToken token, @Valid Meal meal); @POST @Path("/{id}/delete") Response deleteMeal(@Auth AccessToken token, @PathParam("id") Long id); @POST @Path("/{id}/checkeat") Response checkEat(@Auth AccessToken token, @PathParam("id") Long id); @GET @Path("/{id}/checkate/{uid}") Boolean checkAte( @PathParam("id") Long id,  @PathParam("uid") Long uid); @POST @Path("/{id}/rate/{rating}") Response rateMeal(@Auth AccessToken token, @PathParam("id") Long id, @PathParam("rating") Float rating); @GET @Path("/{id}/ratings") Ratings getRatings(@Auth AccessToken token, @PathParam("id") Long id); @GET @Path("/byTag/{tag}") List<Meal> mealsByTag(@PathParam("tag") String tag); @GET @Path("/{id}/tags") List<Tag> tagsByMeal(@PathParam("id") Long id); @GET @Path("/{id}/comments") List<Comment> commentsByMeal(@PathParam("id") Long id); @POST @Path("/tag") Response tagMeal(@Auth AccessToken token, Tag tag); @POST @Path("/untag") Response untagMeal(@Auth AccessToken token, Tag tag); @GET @Path("/{id}/nutrition") NutritionalInfo getNutrition(@PathParam("id") Long id); @GET @Path("/search/{query}") List<Meal> basicSearch(@PathParam("query") String query);  }
@Test public void testBasicSearch() throws Exception { Response res = rule.getJerseyTest() .target("/meal/search/test") .request(MediaType.APPLICATION_JSON_TYPE) .get(); @SuppressWarnings({ "rawtypes", "unchecked" }) ArrayList<LinkedHashMap> read = mapper.readValue(res.readEntity(String.class), ArrayList.class); assertThat(read.size()).isEqualTo(1); }