@Test public void multipleMessageAndTagsTest() { addMessage("test1", "tag1", "tag2"); addMessage("test2", "tag3", "tag4"); List<AcceptedMessageModel> allMessages = target("messages") .queryParam("tag", "tag3") .request() .get(messagesType); assertEquals(1, allMessages.size()); }
@POST @Consumes(MediaType.APPLICATION_JSON) public Response addMessage(@Valid final Message message) { env.addMessage(message); return Response.status(Response.Status.CREATED).build(); }
MessagesController { @POST @Consumes(MediaType.APPLICATION_JSON) public Response addMessage(@Valid final Message message) { env.addMessage(message); return Response.status(Response.Status.CREATED).build(); } }
MessagesController { @POST @Consumes(MediaType.APPLICATION_JSON) public Response addMessage(@Valid final Message message) { env.addMessage(message); return Response.status(Response.Status.CREATED).build(); }  }
MessagesController { @POST @Consumes(MediaType.APPLICATION_JSON) public Response addMessage(@Valid final Message message) { env.addMessage(message); return Response.status(Response.Status.CREATED).build(); }  @POST @Consumes(MediaType.APPLICATION_JSON) Response addMessage(@Valid final Message message); @DELETE @Consumes(MediaType.TEXT_PLAIN) void removeMessagesWithTag(@QueryParam("tag") final String tag, final String text); @GET @Produces(MediaType.APPLICATION_JSON) Set<AcceptedMessage> getMessages(@QueryParam("tag") final String tag); }
MessagesController { @POST @Consumes(MediaType.APPLICATION_JSON) public Response addMessage(@Valid final Message message) { env.addMessage(message); return Response.status(Response.Status.CREATED).build(); }  @POST @Consumes(MediaType.APPLICATION_JSON) Response addMessage(@Valid final Message message); @DELETE @Consumes(MediaType.TEXT_PLAIN) void removeMessagesWithTag(@QueryParam("tag") final String tag, final String text); @GET @Produces(MediaType.APPLICATION_JSON) Set<AcceptedMessage> getMessages(@QueryParam("tag") final String tag);  }