@Test @RunWithCustomExecutor public void test_when_update_accession_register_then_FATAL() throws Exception { when(adminManagementClient.createOrUpdateAccessionRegister(any())) .thenThrow(new AdminManagementClientServerException("Simulate FATAL")); RequestResponse response = new RequestResponseOK<>().setHttpCode(Response.Status.OK.getStatusCode()); when(adminManagementClient.getAccessionRegister(any())).thenReturn(response); ItemStatus itemStatus = instance.execute(params, handler); Assertions.assertThat(itemStatus).isNotNull(); Assertions.assertThat(itemStatus.getGlobalStatus()).isEqualTo(StatusCode.FATAL); }
@Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { updateAccessionRegister(param); LOGGER.info("Purge accession register update succeeded"); return buildItemStatus(actionId, StatusCode.OK, null); } catch (ProcessingStatusException e) { LOGGER.error(String.format( "Purge accession register update failed with status [%s]", e.getStatusCode()), e); return buildItemStatus(actionId, e.getStatusCode(), e.getEventDetails()); } }
PurgeAccessionRegisterUpdatePlugin extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { updateAccessionRegister(param); LOGGER.info("Purge accession register update succeeded"); return buildItemStatus(actionId, StatusCode.OK, null); } catch (ProcessingStatusException e) { LOGGER.error(String.format( "Purge accession register update failed with status [%s]", e.getStatusCode()), e); return buildItemStatus(actionId, e.getStatusCode(), e.getEventDetails()); } } }
PurgeAccessionRegisterUpdatePlugin extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { updateAccessionRegister(param); LOGGER.info("Purge accession register update succeeded"); return buildItemStatus(actionId, StatusCode.OK, null); } catch (ProcessingStatusException e) { LOGGER.error(String.format( "Purge accession register update failed with status [%s]", e.getStatusCode()), e); return buildItemStatus(actionId, e.getStatusCode(), e.getEventDetails()); } } PurgeAccessionRegisterUpdatePlugin(String actionId, LogbookTypeProcess logbookTypeProcess); @VisibleForTesting protected  PurgeAccessionRegisterUpdatePlugin(String actionId, LogbookTypeProcess logbookTypeProcess,
        AdminManagementClientFactory adminManagementClientFactory); }
PurgeAccessionRegisterUpdatePlugin extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { updateAccessionRegister(param); LOGGER.info("Purge accession register update succeeded"); return buildItemStatus(actionId, StatusCode.OK, null); } catch (ProcessingStatusException e) { LOGGER.error(String.format( "Purge accession register update failed with status [%s]", e.getStatusCode()), e); return buildItemStatus(actionId, e.getStatusCode(), e.getEventDetails()); } } PurgeAccessionRegisterUpdatePlugin(String actionId, LogbookTypeProcess logbookTypeProcess); @VisibleForTesting protected  PurgeAccessionRegisterUpdatePlugin(String actionId, LogbookTypeProcess logbookTypeProcess,
        AdminManagementClientFactory adminManagementClientFactory); @Override ItemStatus execute(WorkerParameters param, HandlerIO handler); @Override void checkMandatoryIOParameter(HandlerIO handler); }
PurgeAccessionRegisterUpdatePlugin extends ActionHandler { @Override public ItemStatus execute(WorkerParameters param, HandlerIO handler) throws ProcessingException { try { updateAccessionRegister(param); LOGGER.info("Purge accession register update succeeded"); return buildItemStatus(actionId, StatusCode.OK, null); } catch (ProcessingStatusException e) { LOGGER.error(String.format( "Purge accession register update failed with status [%s]", e.getStatusCode()), e); return buildItemStatus(actionId, e.getStatusCode(), e.getEventDetails()); } } PurgeAccessionRegisterUpdatePlugin(String actionId, LogbookTypeProcess logbookTypeProcess); @VisibleForTesting protected  PurgeAccessionRegisterUpdatePlugin(String actionId, LogbookTypeProcess logbookTypeProcess,
        AdminManagementClientFactory adminManagementClientFactory); @Override ItemStatus execute(WorkerParameters param, HandlerIO handler); @Override void checkMandatoryIOParameter(HandlerIO handler);  }