@Test public void getAllMessagesTest() { addMessage("text1", "info"); addMessage("text2", "main"); List<AcceptedMessageModel> allMessages = target("messages") .request() .get(messagesType); assertEquals(2, 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);  }