@RunWithCustomExecutor @Test public void testNotAnIngestLogbookOperationThenKO() throws Exception { givenLogbookOperation("IngestCleanup/RequestValidation/notAnIngestOperation.json"); givenNoActiveProcess(); ItemStatus itemStatus = instance.execute(params, handlerIO); assertThat(itemStatus.getGlobalStatus()).isEqualTo(StatusCode.KO); }
@Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { String ingestOperationId = param.getParameterValue(WorkerParameterName.ingestOperationIdToCleanup); checkIngestOperationId(ingestOperationId); LOGGER.info("Ingest cleanup request validation succeeded"); return buildItemStatus(INGEST_CLEANUP_REQUEST_VALIDATION, StatusCode.OK); } catch (ProcessingStatusException e) { LOGGER.error(String.format( "Ingest cleanup request validation failed with status [%s]", e.getStatusCode()), e); return buildItemStatus(INGEST_CLEANUP_REQUEST_VALIDATION, e.getStatusCode(), e.getEventDetails()); } }
IngestCleanupRequestValidationPlugin extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { String ingestOperationId = param.getParameterValue(WorkerParameterName.ingestOperationIdToCleanup); checkIngestOperationId(ingestOperationId); LOGGER.info("Ingest cleanup request validation succeeded"); return buildItemStatus(INGEST_CLEANUP_REQUEST_VALIDATION, StatusCode.OK); } catch (ProcessingStatusException e) { LOGGER.error(String.format( "Ingest cleanup request validation failed with status [%s]", e.getStatusCode()), e); return buildItemStatus(INGEST_CLEANUP_REQUEST_VALIDATION, e.getStatusCode(), e.getEventDetails()); } } }
IngestCleanupRequestValidationPlugin extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { String ingestOperationId = param.getParameterValue(WorkerParameterName.ingestOperationIdToCleanup); checkIngestOperationId(ingestOperationId); LOGGER.info("Ingest cleanup request validation succeeded"); return buildItemStatus(INGEST_CLEANUP_REQUEST_VALIDATION, StatusCode.OK); } catch (ProcessingStatusException e) { LOGGER.error(String.format( "Ingest cleanup request validation failed with status [%s]", e.getStatusCode()), e); return buildItemStatus(INGEST_CLEANUP_REQUEST_VALIDATION, e.getStatusCode(), e.getEventDetails()); } } IngestCleanupRequestValidationPlugin(); @VisibleForTesting  IngestCleanupRequestValidationPlugin(
        ProcessingManagementClientFactory processingManagementClientFactory,
        LogbookOperationsClientFactory logbookOperationsClientFactory); }
IngestCleanupRequestValidationPlugin extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { String ingestOperationId = param.getParameterValue(WorkerParameterName.ingestOperationIdToCleanup); checkIngestOperationId(ingestOperationId); LOGGER.info("Ingest cleanup request validation succeeded"); return buildItemStatus(INGEST_CLEANUP_REQUEST_VALIDATION, StatusCode.OK); } catch (ProcessingStatusException e) { LOGGER.error(String.format( "Ingest cleanup request validation failed with status [%s]", e.getStatusCode()), e); return buildItemStatus(INGEST_CLEANUP_REQUEST_VALIDATION, e.getStatusCode(), e.getEventDetails()); } } IngestCleanupRequestValidationPlugin(); @VisibleForTesting  IngestCleanupRequestValidationPlugin(
        ProcessingManagementClientFactory processingManagementClientFactory,
        LogbookOperationsClientFactory logbookOperationsClientFactory); @Override ItemStatus execute(WorkerParameters param, HandlerIO handler); }
IngestCleanupRequestValidationPlugin extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { String ingestOperationId = param.getParameterValue(WorkerParameterName.ingestOperationIdToCleanup); checkIngestOperationId(ingestOperationId); LOGGER.info("Ingest cleanup request validation succeeded"); return buildItemStatus(INGEST_CLEANUP_REQUEST_VALIDATION, StatusCode.OK); } catch (ProcessingStatusException e) { LOGGER.error(String.format( "Ingest cleanup request validation failed with status [%s]", e.getStatusCode()), e); return buildItemStatus(INGEST_CLEANUP_REQUEST_VALIDATION, e.getStatusCode(), e.getEventDetails()); } } IngestCleanupRequestValidationPlugin(); @VisibleForTesting  IngestCleanupRequestValidationPlugin(
        ProcessingManagementClientFactory processingManagementClientFactory,
        LogbookOperationsClientFactory logbookOperationsClientFactory); @Override ItemStatus execute(WorkerParameters param, HandlerIO handler);  }