TicketsResource extends AbstractResource { @POST @Consumes(MediaType.APPLICATION_JSON) public Response create(@Valid @NotNull(message = "Input must not be null.") final TicketInput ticketInput) { ticketService.create(getAuthenticatedUser(), ticketMapper.convert(ticketInput)); return Response.created(URI.create("")).build(); }  @POST @Consumes(MediaType.APPLICATION_JSON) Response create(@Valid @NotNull(message = "Input must not be null.") final TicketInput ticketInput);  }
@Test public void shouldCreate() { resetAllMocks(); TicketInput input = new TicketInput() .subject("A") .content("B"); final Response response = target().request().post(Entity.json(input)); assertEquals(HttpStatusCode.CREATED_201, response.getStatus()); Mockito.verify(ticketMapper).convert(input); Mockito.verify(ticketService).create(eq(USER_NAME), any()); }