@Override public ExecutionErrorSummary apply(final ExecutionErrorInstance executionErrorInstance) { if (executionErrorInstance == null) { return null; } return ExecutionErrorSummary.builder() .errorId(executionErrorInstance.getErrorId()) .error(executionErrorInstance.getError()) .acknowledged(executionErrorInstance.isAcknowledged()) .acknowledgedAt(executionErrorInstance.getAcknowledgedAt()) .acknowledgedBy(executionErrorInstance.getAcknowledgedBy()) .activityId(executionErrorInstance.getActivityId()) .activityName(executionErrorInstance.getActivityName()) .errorDate(executionErrorInstance.getErrorDate()) .type(ExecutionErrorType.fromType(executionErrorInstance.getType())) .deploymentId(executionErrorInstance.getContainerId()) .processInstanceId(executionErrorInstance.getProcessInstanceId()) .processId(executionErrorInstance.getProcessId()) .jobId(executionErrorInstance.getJobId()) .message(executionErrorInstance.getErrorMessage()) .build(); } }
@Test public void testGetExecutionErrorDetails() { final ExecutionErrorInstance errorInstance = createTestError("1"); String serverTemplateId = "testServerTemplateId"; when(processAdminServicesClient.getError(errorInstance.getContainerId(), errorInstance.getErrorId())) .thenReturn(errorInstance); final ExecutionErrorSummary errorSummary = executorService.getError(serverTemplateId, errorInstance.getContainerId(), errorInstance.getErrorId()); verify(kieServerIntegration).getServerClient(serverTemplateId); verify(processAdminServicesClient).getError(errorInstance.getContainerId(), errorInstance.getErrorId()); assertExecutionErrorSummary(errorInstance, errorSummary); } }
assertNotNull(errorInstance.getErrorId()); assertNull(errorInstance.getError()); assertNotNull(errorInstance.getProcessInstanceId()); assertNotNull(errorInstance.getActivityId()); assertNotNull(errorInstance.getErrorDate()); assertEquals(CONTAINER_ID, errorInstance.getContainerId()); assertEquals(PROCESS_ID_TIMER, errorInstance.getProcessId()); assertEquals("timer", errorInstance.getActivityName()); assertFalse(errorInstance.isAcknowledged()); assertNull(errorInstance.getAcknowledgedAt()); assertNull(errorInstance.getAcknowledgedBy()); processAdminClient.acknowledgeError(CONTAINER_ID, errorInstance.getErrorId()); assertEquals(0, errors.size()); errorInstance = processAdminClient.getError(CONTAINER_ID, errorInstance.getErrorId()); assertNotNull(errorInstance); assertNotNull(errorInstance.getErrorId()); assertTrue(errorInstance.isAcknowledged()); assertNotNull(errorInstance.getAcknowledgedAt()); assertEquals(USER_YODA, errorInstance.getAcknowledgedBy());
assertFalse(errorInstance.isAcknowledged()); assertNull(errorInstance.getAcknowledgedAt()); assertNull(errorInstance.getAcknowledgedBy()); assertFalse(errorInstance2.isAcknowledged()); assertNull(errorInstance2.getAcknowledgedAt()); assertNull(errorInstance2.getAcknowledgedBy()); processAdminClient.acknowledgeError(CONTAINER_ID, errorInstance.getErrorId(), errorInstance2.getErrorId()); assertEquals(0, errors.size()); errorInstance = processAdminClient.getError(CONTAINER_ID, errorInstance.getErrorId()); assertNotNull(errorInstance); assertNotNull(errorInstance.getErrorId()); assertTrue(errorInstance.isAcknowledged()); assertNotNull(errorInstance.getAcknowledgedAt()); assertEquals(USER_YODA, errorInstance.getAcknowledgedBy());
assertEquals(1, errors.size()); ExecutionErrorInstance errorInstance = errors.get(0); assertNotNull(errorInstance.getErrorId()); assertNull(errorInstance.getError()); assertNotNull(errorInstance.getProcessInstanceId()); assertNotNull(errorInstance.getActivityId()); assertNotNull(errorInstance.getErrorDate()); assertEquals(CONTAINER_ID, errorInstance.getContainerId()); assertEquals(PROCESS_ID_SIGNAL_PROCESS, errorInstance.getProcessId()); assertEquals("Signal 1 data", errorInstance.getActivityName()); assertFalse(errorInstance.isAcknowledged()); assertNull(errorInstance.getAcknowledgedAt()); assertNull(errorInstance.getAcknowledgedBy()); userTaskAdminClient.acknowledgeError(CONTAINER_ID, errorInstance.getErrorId()); errorInstance = userTaskAdminClient.getError(CONTAINER_ID, errorInstance.getErrorId()); assertNotNull(errorInstance); assertNotNull(errorInstance.getErrorId()); assertTrue(errorInstance.isAcknowledged()); assertNotNull(errorInstance.getAcknowledgedAt()); assertEquals(USER_YODA, errorInstance.getAcknowledgedBy()); } catch (KieServicesException e) { logger.error("Unexpected error", e);
@Test public void testGetExecutionErrorDetails() { final ExecutionErrorInstance errorInstance = createTestError("1"); String serverTemplateId = "testServerTemplateId"; when(processAdminServicesClient.getError(errorInstance.getContainerId(), errorInstance.getErrorId())) .thenReturn(errorInstance); final ExecutionErrorSummary errorSummary = executorService.getError(serverTemplateId, errorInstance.getContainerId(), errorInstance.getErrorId()); verify(kieServerIntegration).getServerClient(serverTemplateId); verify(processAdminServicesClient).getError(errorInstance.getContainerId(), errorInstance.getErrorId()); assertExecutionErrorSummary(errorInstance, errorSummary); } }
assertEquals(error.getErrorMessage(), es.getErrorMessage()); assertEquals(error.getError(), es.getError()); assertEquals(error.getType(), es.getType().getType()); assertEquals(error.getErrorMessage(), es.getErrorMessage()); assertEquals(error.getAcknowledgedAt(), es.getAcknowledgedAt()); assertEquals(error.getAcknowledgedBy(), es.getAcknowledgedBy()); assertEquals(error.isAcknowledged(), es.isAcknowledged()); assertEquals(error.getActivityId(), es.getActivityId()); assertEquals(error.getActivityName(), es.getActivityName()); assertEquals(error.getContainerId(), es.getDeploymentId()); assertEquals(error.getErrorId(), es.getErrorId()); assertEquals(error.getProcessId(), es.getProcessId()); assertEquals(error.getProcessInstanceId(), es.getProcessInstanceId()); assertEquals(error.getJobId(), es.getJobId());
assertEquals(1, errors.size()); ExecutionErrorInstance errorInstance = errors.get(0); assertNotNull(errorInstance.getErrorId()); assertNull(errorInstance.getError()); assertNotNull(errorInstance.getProcessInstanceId()); assertNotNull(errorInstance.getActivityId()); assertNotNull(errorInstance.getErrorDate()); assertEquals(CONTAINER_ID, errorInstance.getContainerId()); assertEquals(PROCESS_ID_SIGNAL_PROCESS, errorInstance.getProcessId()); assertEquals("Signal 1 data", errorInstance.getActivityName()); assertFalse(errorInstance.isAcknowledged()); assertNull(errorInstance.getAcknowledgedAt()); assertNull(errorInstance.getAcknowledgedBy()); assertEquals(1, errors.size()); ExecutionErrorInstance errorInstance2 = errors.get(0); assertEquals(errorInstance.getErrorId(), errorInstance2.getErrorId()); processAdminClient.acknowledgeError(CONTAINER_ID, errorInstance.getErrorId()); errorInstance = processAdminClient.getError(CONTAINER_ID, errorInstance.getErrorId()); assertNotNull(errorInstance); assertNotNull(errorInstance.getErrorId()); assertTrue(errorInstance.isAcknowledged()); assertNotNull(errorInstance.getAcknowledgedAt()); assertEquals(USER_YODA, errorInstance.getAcknowledgedBy()); } catch (KieServicesException e) {
assertEquals(error.getErrorMessage(), es.getErrorMessage()); assertEquals(error.getError(), es.getError()); assertEquals(error.getType(), es.getType().getType()); assertEquals(error.getErrorMessage(), es.getErrorMessage()); assertEquals(error.getAcknowledgedAt(), es.getAcknowledgedAt()); assertEquals(error.getAcknowledgedBy(), es.getAcknowledgedBy()); assertEquals(error.isAcknowledged(), es.isAcknowledged()); assertEquals(error.getActivityId(), es.getActivityId()); assertEquals(error.getActivityName(), es.getActivityName()); assertEquals(error.getContainerId(), es.getDeploymentId()); assertEquals(error.getErrorId(), es.getErrorId()); assertEquals(error.getProcessId(), es.getProcessId()); assertEquals(error.getProcessInstanceId(), es.getProcessInstanceId()); assertEquals(error.getJobId(), es.getJobId());
assertEquals(1, errors.size()); ExecutionErrorInstance errorInstance = errors.get(0); assertNotNull(errorInstance.getErrorId()); assertNull(errorInstance.getError()); assertNotNull(errorInstance.getProcessInstanceId()); assertNotNull(errorInstance.getActivityId()); assertNotNull(errorInstance.getErrorDate()); assertEquals(CONTAINER_ID, errorInstance.getContainerId()); assertEquals(PROCESS_ID_SIGNAL_PROCESS, errorInstance.getProcessId()); assertEquals("Signal 1 data", errorInstance.getActivityName()); assertFalse(errorInstance.isAcknowledged()); assertNull(errorInstance.getAcknowledgedAt()); assertNull(errorInstance.getAcknowledgedBy()); assertEquals(1, errors.size()); ExecutionErrorInstance errorInstance2 = errors.get(0); assertEquals(errorInstance.getErrorId(), errorInstance2.getErrorId()); processAdminClient.acknowledgeError(CONTAINER_ID, errorInstance.getErrorId()); errorInstance = processAdminClient.getError(CONTAINER_ID, errorInstance.getErrorId()); assertNotNull(errorInstance); assertNotNull(errorInstance.getErrorId()); assertTrue(errorInstance.isAcknowledged()); assertNotNull(errorInstance.getAcknowledgedAt()); assertEquals(USER_YODA, errorInstance.getAcknowledgedBy()); } catch (Exception e) {