@Test @RunWithCustomExecutor public void switchIndexesTest() throws InvalidParseOperationException, LogbookClientServerException { when(mock.post()).thenReturn(Response.status(Status.OK).entity(JsonHandler.createObjectNode()) .build()); JsonNode resp = client.switchIndexes(new SwitchIndexParameters()); assertNotNull(resp); }
@Override public JsonNode switchIndexes(SwitchIndexParameters switchIndexParam) throws InvalidParseOperationException, LogbookClientServerException { try (Response response = make(post().withPath("/alias").withBody(switchIndexParam, "The options are mandatory").withJson())) { check(response); return response.readEntity(JsonNode.class); } catch (LogbookClientNotFoundException | LogbookClientAlreadyExistsException | LogbookClientBadRequestException | VitamClientInternalException e) { throw new LogbookClientServerException(ErrorMessage.INTERNAL_SERVER_ERROR.getMessage(), e); } }
LogbookOperationsClientRest extends DefaultClient implements LogbookOperationsClient { @Override public JsonNode switchIndexes(SwitchIndexParameters switchIndexParam) throws InvalidParseOperationException, LogbookClientServerException { try (Response response = make(post().withPath("/alias").withBody(switchIndexParam, "The options are mandatory").withJson())) { check(response); return response.readEntity(JsonNode.class); } catch (LogbookClientNotFoundException | LogbookClientAlreadyExistsException | LogbookClientBadRequestException | VitamClientInternalException e) { throw new LogbookClientServerException(ErrorMessage.INTERNAL_SERVER_ERROR.getMessage(), e); } } }
LogbookOperationsClientRest extends DefaultClient implements LogbookOperationsClient { @Override public JsonNode switchIndexes(SwitchIndexParameters switchIndexParam) throws InvalidParseOperationException, LogbookClientServerException { try (Response response = make(post().withPath("/alias").withBody(switchIndexParam, "The options are mandatory").withJson())) { check(response); return response.readEntity(JsonNode.class); } catch (LogbookClientNotFoundException | LogbookClientAlreadyExistsException | LogbookClientBadRequestException | VitamClientInternalException e) { throw new LogbookClientServerException(ErrorMessage.INTERNAL_SERVER_ERROR.getMessage(), e); } } LogbookOperationsClientRest(LogbookOperationsClientFactory factory); }
LogbookOperationsClientRest extends DefaultClient implements LogbookOperationsClient { @Override public JsonNode switchIndexes(SwitchIndexParameters switchIndexParam) throws InvalidParseOperationException, LogbookClientServerException { try (Response response = make(post().withPath("/alias").withBody(switchIndexParam, "The options are mandatory").withJson())) { check(response); return response.readEntity(JsonNode.class); } catch (LogbookClientNotFoundException | LogbookClientAlreadyExistsException | LogbookClientBadRequestException | VitamClientInternalException 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 JsonNode switchIndexes(SwitchIndexParameters switchIndexParam) throws InvalidParseOperationException, LogbookClientServerException { try (Response response = make(post().withPath("/alias").withBody(switchIndexParam, "The options are mandatory").withJson())) { check(response); return response.readEntity(JsonNode.class); } catch (LogbookClientNotFoundException | LogbookClientAlreadyExistsException | LogbookClientBadRequestException | VitamClientInternalException 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();  }