@Test public void addMessageTest() { addMessage("test message"); assertFalse(env.getMessages().isEmpty()); AcceptedMessage msg = env.getMessages().first(); assertEquals("test&nbsp;message", msg.getMessage().getText()); }
@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);  }