void process(MaestroJobEvent maestroJob) {
    LOG.info("process a maestro job event: [{}]", maestroJob);
    switch (maestroJob.getType()) {
      case DELETE_WORKFLOW_JOB_EVENT:
        deleteWorkflowJobProcessor.process(() -> (DeleteWorkflowJobEvent) maestroJob);
        break;
      case RUN_WORKFLOW_INSTANCES_JOB_EVENT:
        runWorkflowInstancesJobProcessor.process(() -> (RunWorkflowInstancesJobEvent) maestroJob);
        break;
      case START_WORKFLOW_JOB_EVENT:
        startWorkflowJobProcessor.process(() -> (StartWorkflowJobEvent) maestroJob);
        break;
      case TERMINATE_INSTANCES_JOB_EVENT:
        terminateInstancesJobProcessor.process(() -> (TerminateInstancesJobEvent) maestroJob);
        break;
      case TERMINATE_THEN_RUN_JOB_EVENT:
        terminateThenRunInstanceJobProcessor.process(
            () -> (TerminateThenRunInstanceJobEvent) maestroJob);
        break;
      default:
        publishJobEventProcessor.process(() -> maestroJob);
        break;
    }
  }
@Test
  public void testProcess() {
    MaestroJobEvent event = Mockito.mock(DeleteWorkflowJobEvent.class);
    when(event.getType()).thenCallRealMethod();
    jobEventListener.process(event);
    verify(deleteWorkflowJobProcessor, times(1)).process(any());
    event = Mockito.mock(RunWorkflowInstancesJobEvent.class);
    when(event.getType()).thenCallRealMethod();
    jobEventListener.process(event);
    verify(runWorkflowInstancesJobProcessor, times(1)).process(any());
    event = Mockito.mock(StartWorkflowJobEvent.class);
    when(event.getType()).thenCallRealMethod();
    jobEventListener.process(event);
    verify(startWorkflowJobProcessor, times(1)).process(any());
    event = Mockito.mock(TerminateInstancesJobEvent.class);
    when(event.getType()).thenCallRealMethod();
    jobEventListener.process(event);
    verify(terminateInstancesJobProcessor, times(1)).process(any());
    event = Mockito.mock(TerminateThenRunInstanceJobEvent.class);
    when(event.getType()).thenCallRealMethod();
    jobEventListener.process(event);
    verify(terminateThenRunInstanceJobProcessor, times(1)).process(any());

    event = Mockito.mock(StepInstanceUpdateJobEvent.class);
    when(event.getType()).thenCallRealMethod();
    jobEventListener.process(event);
    event = Mockito.mock(StepInstanceWakeUpEvent.class);
    when(event.getType()).thenCallRealMethod();
    jobEventListener.process(event);
    event = Mockito.mock(WorkflowInstanceUpdateJobEvent.class);
    when(event.getType()).thenCallRealMethod();
    jobEventListener.process(event);
    event = Mockito.mock(WorkflowVersionUpdateJobEvent.class);
    when(event.getType()).thenCallRealMethod();
    jobEventListener.process(event);
    verify(publishJobEventProcessor, times(4)).process(any());
  }