BPMNErrorConverter { public BPMNErrorImpl convertToBPMNError(ActivitiErrorEvent internalEvent) { BPMNErrorImpl bpmnError = new BPMNErrorImpl(internalEvent.getActivityId(), internalEvent.getActivityName(), internalEvent.getActivityType()); bpmnError.setProcessDefinitionId(internalEvent.getProcessDefinitionId()); bpmnError.setProcessInstanceId(internalEvent.getProcessInstanceId()); bpmnError.setExecutionId(internalEvent.getExecutionId()); bpmnError.setErrorId(internalEvent.getErrorId()); bpmnError.setErrorCode(internalEvent.getErrorCode()); return bpmnError; }  BPMNErrorImpl convertToBPMNError(ActivitiErrorEvent internalEvent);  }
@Test public void convertShouldReturnBPMNError() { ActivitiErrorEvent internalEvent = mock(ActivitiErrorEvent.class); given(internalEvent.getErrorId()).willReturn("errorId"); given(internalEvent.getErrorCode()).willReturn("errorCode"); given(internalEvent.getActivityName()).willReturn("activityName"); given(internalEvent.getActivityType()).willReturn("activityType"); given(internalEvent.getProcessDefinitionId()).willReturn("procDefId"); given(internalEvent.getProcessInstanceId()).willReturn("procInstId"); BPMNErrorImpl bpmnError = bpmnErrorConverter.convertToBPMNError(internalEvent); assertThat(bpmnError).isNotNull(); assertThat(bpmnError.getProcessInstanceId()).isEqualTo("procInstId"); assertThat(bpmnError.getProcessDefinitionId()).isEqualTo("procDefId"); assertThat(bpmnError.getErrorId()).isEqualTo("errorId"); assertThat(bpmnError.getErrorCode()).isEqualTo("errorCode"); assertThat(bpmnError.getActivityName()).isEqualTo("activityName"); assertThat(bpmnError.getActivityType()).isEqualTo("activityType"); }