@Test public void shouldFindGriffin() throws Exception { Response griffinResponse = preservationResource.findGriffin(getFromString("{}")); assertThat(griffinResponse.getStatus()).isEqualTo(200); }
@GET @Path("/griffin") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response findGriffin(JsonNode queryDsl) { try { RequestResponse<GriffinModel> requestResponse = griffinService.findGriffin(queryDsl); return Response.status(Status.OK).entity(requestResponse).build(); } catch (InvalidParseOperationException | BadRequestException e) { LOGGER.error("Unexpected server error {}", e); return buildErrorResponse(VitamCode.PRESERVATION_VALIDATION_ERROR, e.getMessage()); } catch (ReferentialException e) { LOGGER.error(e); return buildErrorResponse(VitamCode.GLOBAL_INTERNAL_SERVER_ERROR, e.getMessage()); } }
PreservationResource { @GET @Path("/griffin") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response findGriffin(JsonNode queryDsl) { try { RequestResponse<GriffinModel> requestResponse = griffinService.findGriffin(queryDsl); return Response.status(Status.OK).entity(requestResponse).build(); } catch (InvalidParseOperationException | BadRequestException e) { LOGGER.error("Unexpected server error {}", e); return buildErrorResponse(VitamCode.PRESERVATION_VALIDATION_ERROR, e.getMessage()); } catch (ReferentialException e) { LOGGER.error(e); return buildErrorResponse(VitamCode.GLOBAL_INTERNAL_SERVER_ERROR, e.getMessage()); } } }
PreservationResource { @GET @Path("/griffin") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response findGriffin(JsonNode queryDsl) { try { RequestResponse<GriffinModel> requestResponse = griffinService.findGriffin(queryDsl); return Response.status(Status.OK).entity(requestResponse).build(); } catch (InvalidParseOperationException | BadRequestException e) { LOGGER.error("Unexpected server error {}", e); return buildErrorResponse(VitamCode.PRESERVATION_VALIDATION_ERROR, e.getMessage()); } catch (ReferentialException e) { LOGGER.error(e); return buildErrorResponse(VitamCode.GLOBAL_INTERNAL_SERVER_ERROR, e.getMessage()); } } PreservationResource(PreservationScenarioService preservationScenarioService, GriffinService griffinService); }
PreservationResource { @GET @Path("/griffin") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response findGriffin(JsonNode queryDsl) { try { RequestResponse<GriffinModel> requestResponse = griffinService.findGriffin(queryDsl); return Response.status(Status.OK).entity(requestResponse).build(); } catch (InvalidParseOperationException | BadRequestException e) { LOGGER.error("Unexpected server error {}", e); return buildErrorResponse(VitamCode.PRESERVATION_VALIDATION_ERROR, e.getMessage()); } catch (ReferentialException e) { LOGGER.error(e); return buildErrorResponse(VitamCode.GLOBAL_INTERNAL_SERVER_ERROR, e.getMessage()); } } PreservationResource(PreservationScenarioService preservationScenarioService, GriffinService griffinService); @POST @Path("/importGriffins") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response importGriffin(List<GriffinModel> griffinModelList, @Context UriInfo uri); @POST @Path("/importPreservationScenarios") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response importPreservationScenario(List<PreservationScenarioModel> preservationScenarioModel,
        @Context UriInfo uri); @GET @Path("/griffin") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response findGriffin(JsonNode queryDsl); @GET @Path("/preservationScenario") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response findPreservation(JsonNode queryDsl); }
PreservationResource { @GET @Path("/griffin") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response findGriffin(JsonNode queryDsl) { try { RequestResponse<GriffinModel> requestResponse = griffinService.findGriffin(queryDsl); return Response.status(Status.OK).entity(requestResponse).build(); } catch (InvalidParseOperationException | BadRequestException e) { LOGGER.error("Unexpected server error {}", e); return buildErrorResponse(VitamCode.PRESERVATION_VALIDATION_ERROR, e.getMessage()); } catch (ReferentialException e) { LOGGER.error(e); return buildErrorResponse(VitamCode.GLOBAL_INTERNAL_SERVER_ERROR, e.getMessage()); } } PreservationResource(PreservationScenarioService preservationScenarioService, GriffinService griffinService); @POST @Path("/importGriffins") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response importGriffin(List<GriffinModel> griffinModelList, @Context UriInfo uri); @POST @Path("/importPreservationScenarios") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response importPreservationScenario(List<PreservationScenarioModel> preservationScenarioModel,
        @Context UriInfo uri); @GET @Path("/griffin") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response findGriffin(JsonNode queryDsl); @GET @Path("/preservationScenario") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response findPreservation(JsonNode queryDsl);  }