@Test public void testGetQuestionDraftNotFound() { final String intygId = "intygId"; when(arendeDraftService.getQuestionDraft(intygId)).thenReturn(null); Response res = controller.getQuestionDraft(intygId); assertNotNull(res); assertEquals(Response.Status.NO_CONTENT.getStatusCode(), res.getStatus()); verify(arendeDraftService).getQuestionDraft(intygId); }
@GET @Path("/{intygId}") @Produces(MediaType.APPLICATION_JSON) @PrometheusTimeMethod public Response getQuestionDraft(@PathParam("intygId") String intygId) { ArendeDraft questionDraft = arendeDraftService.getQuestionDraft(intygId); if (questionDraft != null) { return Response.ok(ArendeDraftEntry.fromArendeDraft(questionDraft)).build(); } else { return Response.status(Response.Status.NO_CONTENT).build(); } }
ArendeDraftApiController { @GET @Path("/{intygId}") @Produces(MediaType.APPLICATION_JSON) @PrometheusTimeMethod public Response getQuestionDraft(@PathParam("intygId") String intygId) { ArendeDraft questionDraft = arendeDraftService.getQuestionDraft(intygId); if (questionDraft != null) { return Response.ok(ArendeDraftEntry.fromArendeDraft(questionDraft)).build(); } else { return Response.status(Response.Status.NO_CONTENT).build(); } } }
ArendeDraftApiController { @GET @Path("/{intygId}") @Produces(MediaType.APPLICATION_JSON) @PrometheusTimeMethod public Response getQuestionDraft(@PathParam("intygId") String intygId) { ArendeDraft questionDraft = arendeDraftService.getQuestionDraft(intygId); if (questionDraft != null) { return Response.ok(ArendeDraftEntry.fromArendeDraft(questionDraft)).build(); } else { return Response.status(Response.Status.NO_CONTENT).build(); } }  }
ArendeDraftApiController { @GET @Path("/{intygId}") @Produces(MediaType.APPLICATION_JSON) @PrometheusTimeMethod public Response getQuestionDraft(@PathParam("intygId") String intygId) { ArendeDraft questionDraft = arendeDraftService.getQuestionDraft(intygId); if (questionDraft != null) { return Response.ok(ArendeDraftEntry.fromArendeDraft(questionDraft)).build(); } else { return Response.status(Response.Status.NO_CONTENT).build(); } }  @PUT @Consumes(MediaType.APPLICATION_JSON) @PrometheusTimeMethod Response save(ArendeDraftEntry entry); @DELETE @Path("/{intygId}{questionId:(/[^/]+?)?}") @PrometheusTimeMethod Response delete(@PathParam("intygId") String intygId, @PathParam("questionId") String questionId); @GET @Path("/{intygId}") @Produces(MediaType.APPLICATION_JSON) @PrometheusTimeMethod Response getQuestionDraft(@PathParam("intygId") String intygId); }
ArendeDraftApiController { @GET @Path("/{intygId}") @Produces(MediaType.APPLICATION_JSON) @PrometheusTimeMethod public Response getQuestionDraft(@PathParam("intygId") String intygId) { ArendeDraft questionDraft = arendeDraftService.getQuestionDraft(intygId); if (questionDraft != null) { return Response.ok(ArendeDraftEntry.fromArendeDraft(questionDraft)).build(); } else { return Response.status(Response.Status.NO_CONTENT).build(); } }  @PUT @Consumes(MediaType.APPLICATION_JSON) @PrometheusTimeMethod Response save(ArendeDraftEntry entry); @DELETE @Path("/{intygId}{questionId:(/[^/]+?)?}") @PrometheusTimeMethod Response delete(@PathParam("intygId") String intygId, @PathParam("questionId") String questionId); @GET @Path("/{intygId}") @Produces(MediaType.APPLICATION_JSON) @PrometheusTimeMethod Response getQuestionDraft(@PathParam("intygId") String intygId);  }