@Test public void traceability() throws Exception { VitamThreadUtils.getVitamSession().setTenantId(0); when(mock.post()) .thenReturn( Response.status(Status.OK).entity( "{" + " \"_id\" : \"aedqaaaaacaam7mxaa72uakyaznzeoiaaaaq\"," + " \"evId\" : \"aedqaaaaacaam7mxaa72uakyaznzeoiaaaaq\"," + " \"evType\" : \"PROCESS_SIP_UNITARY\"," + " \"evDateTime\" : \"2016-10-27T13:37:05.646\"," + " \"evDetData\" : null," + " \"evIdProc\" : \"aedqaaaaacaam7mxaa72uakyaznzeoiaaaaq\"," + " \"evTypeProc\" : \"INGEST\"," + " \"outcome\" : \"STARTED\"," + " \"outDetail\" : null," + " \"outMessg\" : \"aedqaaaaacaam7mxaa72uakyaznzeoiaaaaq\"," + " \"agIdApp\" : null," + " \"evIdAppSession\" : null," + " \"evIdReq\" : \"aedqaaaaacaam7mxaa72uakyaznzeoiaaaaq\"," + " \"agIdExt\" : null," + " \"obId\" : null," + " \"obIdReq\" : null," + " \"obIdIn\" : null," + " \"events\" : [ " + " " + " ]," + " \"_tenant\" : 0" + "}") .build()); client.traceability(); }
@Override public RequestResponseOK traceability() throws LogbookClientServerException, InvalidParseOperationException { try (Response response = make(post().withPath("/operations/traceability").withHeader(X_TENANT_ID, getTenantParameter()).withJsonAccept())) { check(response); return RequestResponse.parseRequestResponseOk(response); } catch (LogbookClientNotFoundException | VitamClientInternalException | LogbookClientBadRequestException | LogbookClientAlreadyExistsException e) { throw new LogbookClientServerException(ErrorMessage.INTERNAL_SERVER_ERROR.getMessage(), e); } }
LogbookOperationsClientRest extends DefaultClient implements LogbookOperationsClient { @Override public RequestResponseOK traceability() throws LogbookClientServerException, InvalidParseOperationException { try (Response response = make(post().withPath("/operations/traceability").withHeader(X_TENANT_ID, getTenantParameter()).withJsonAccept())) { check(response); return RequestResponse.parseRequestResponseOk(response); } catch (LogbookClientNotFoundException | VitamClientInternalException | LogbookClientBadRequestException | LogbookClientAlreadyExistsException e) { throw new LogbookClientServerException(ErrorMessage.INTERNAL_SERVER_ERROR.getMessage(), e); } } }
LogbookOperationsClientRest extends DefaultClient implements LogbookOperationsClient { @Override public RequestResponseOK traceability() throws LogbookClientServerException, InvalidParseOperationException { try (Response response = make(post().withPath("/operations/traceability").withHeader(X_TENANT_ID, getTenantParameter()).withJsonAccept())) { check(response); return RequestResponse.parseRequestResponseOk(response); } catch (LogbookClientNotFoundException | VitamClientInternalException | LogbookClientBadRequestException | LogbookClientAlreadyExistsException e) { throw new LogbookClientServerException(ErrorMessage.INTERNAL_SERVER_ERROR.getMessage(), e); } } LogbookOperationsClientRest(LogbookOperationsClientFactory factory); }
LogbookOperationsClientRest extends DefaultClient implements LogbookOperationsClient { @Override public RequestResponseOK traceability() throws LogbookClientServerException, InvalidParseOperationException { try (Response response = make(post().withPath("/operations/traceability").withHeader(X_TENANT_ID, getTenantParameter()).withJsonAccept())) { check(response); return RequestResponse.parseRequestResponseOk(response); } catch (LogbookClientNotFoundException | VitamClientInternalException | LogbookClientBadRequestException | LogbookClientAlreadyExistsException e) { throw new LogbookClientServerException(ErrorMessage.INTERNAL_SERVER_ERROR.getMessage(), e); } } LogbookOperationsClientRest(LogbookOperationsClientFactory factory); @Override void create(LogbookOperationParameters parameters); @Override void update(LogbookOperationParameters parameters); @Override JsonNode selectOperation(JsonNode select); @Override JsonNode selectOperationSliced(JsonNode select); @Override JsonNode selectOperationById(String processId); @Override void createDelegate(LogbookOperationParameters parameters); @Override void updateDelegate(LogbookOperationParameters parameters); @Override void bulkCreate(String eventIdProc, Iterable<LogbookOperationParameters> queue); @Override void commitCreateDelegate(String eventIdProc); @Override void bulkUpdate(String eventIdProc, Iterable<LogbookOperationParameters> queue); @Override void commitUpdateDelegate(String eventIdProc); @Override RequestResponseOK traceability(); @Override RequestResponseOK traceabilityLfcUnit(); @Override RequestResponseOK traceabilityLfcObjectGroup(); @Override LifecycleTraceabilityStatus checkLifecycleTraceabilityWorkflowStatus(String operationId); @Override JsonNode reindex(IndexParameters indexParam); @Override JsonNode switchIndexes(SwitchIndexParameters switchIndexParam); @Override void traceabilityAudit(int tenant, AuditLogbookOptions options); @Override LogbookCheckResult checkLogbookCoherence(); @Override void close(); }
LogbookOperationsClientRest extends DefaultClient implements LogbookOperationsClient { @Override public RequestResponseOK traceability() throws LogbookClientServerException, InvalidParseOperationException { try (Response response = make(post().withPath("/operations/traceability").withHeader(X_TENANT_ID, getTenantParameter()).withJsonAccept())) { check(response); return RequestResponse.parseRequestResponseOk(response); } catch (LogbookClientNotFoundException | VitamClientInternalException | LogbookClientBadRequestException | LogbookClientAlreadyExistsException e) { throw new LogbookClientServerException(ErrorMessage.INTERNAL_SERVER_ERROR.getMessage(), e); } } LogbookOperationsClientRest(LogbookOperationsClientFactory factory); @Override void create(LogbookOperationParameters parameters); @Override void update(LogbookOperationParameters parameters); @Override JsonNode selectOperation(JsonNode select); @Override JsonNode selectOperationSliced(JsonNode select); @Override JsonNode selectOperationById(String processId); @Override void createDelegate(LogbookOperationParameters parameters); @Override void updateDelegate(LogbookOperationParameters parameters); @Override void bulkCreate(String eventIdProc, Iterable<LogbookOperationParameters> queue); @Override void commitCreateDelegate(String eventIdProc); @Override void bulkUpdate(String eventIdProc, Iterable<LogbookOperationParameters> queue); @Override void commitUpdateDelegate(String eventIdProc); @Override RequestResponseOK traceability(); @Override RequestResponseOK traceabilityLfcUnit(); @Override RequestResponseOK traceabilityLfcObjectGroup(); @Override LifecycleTraceabilityStatus checkLifecycleTraceabilityWorkflowStatus(String operationId); @Override JsonNode reindex(IndexParameters indexParam); @Override JsonNode switchIndexes(SwitchIndexParameters switchIndexParam); @Override void traceabilityAudit(int tenant, AuditLogbookOptions options); @Override LogbookCheckResult checkLogbookCoherence(); @Override void close();  }