Search in sources :

Example 1 with CreateHiveTableListener

use of org.apache.inlong.manager.service.thirdparty.hive.CreateHiveTableListener in project incubator-inlong by apache.

the class WorkflowServiceImplTest method mockTaskListenerFactory.

/**
 * Mock the task listener factory
 */
public void mockTaskListenerFactory() {
    CreateTubeGroupTaskListener createTubeGroupTaskListener = mock(CreateTubeGroupTaskListener.class);
    when(createTubeGroupTaskListener.listen(any(WorkflowContext.class))).thenReturn(ListenerResult.success());
    when(createTubeGroupTaskListener.name()).thenReturn(CreateHiveTableListener.class.getSimpleName());
    when(createTubeGroupTaskListener.event()).thenReturn(TaskEvent.COMPLETE);
    taskListenerFactory.setCreateTubeGroupTaskListener(createTubeGroupTaskListener);
    CreateTubeTopicTaskListener createTubeTopicTaskListener = mock(CreateTubeTopicTaskListener.class);
    when(createTubeTopicTaskListener.listen(any(WorkflowContext.class))).thenReturn(ListenerResult.success());
    when(createTubeTopicTaskListener.name()).thenReturn(CreateTubeTopicTaskListener.class.getSimpleName());
    when(createTubeTopicTaskListener.event()).thenReturn(TaskEvent.COMPLETE);
    taskListenerFactory.setCreateTubeTopicTaskListener(createTubeTopicTaskListener);
    CreatePulsarResourceTaskListener createPulsarResourceTaskListener = mock(CreatePulsarResourceTaskListener.class);
    when(createPulsarResourceTaskListener.listen(any(WorkflowContext.class))).thenReturn(ListenerResult.success());
    when(createPulsarResourceTaskListener.name()).thenReturn(CreatePulsarResourceTaskListener.class.getSimpleName());
    when(createPulsarResourceTaskListener.event()).thenReturn(TaskEvent.COMPLETE);
    taskListenerFactory.setCreatePulsarResourceTaskListener(createPulsarResourceTaskListener);
    CreatePulsarGroupTaskListener createPulsarGroupTaskListener = mock(CreatePulsarGroupTaskListener.class);
    when(createPulsarGroupTaskListener.listen(any(WorkflowContext.class))).thenReturn(ListenerResult.success());
    when(createPulsarGroupTaskListener.name()).thenReturn(CreatePulsarGroupTaskListener.class.getSimpleName());
    when(createPulsarGroupTaskListener.event()).thenReturn(TaskEvent.COMPLETE);
    taskListenerFactory.setCreatePulsarGroupTaskListener(createPulsarGroupTaskListener);
    CreateHiveTableListener createHiveTableListener = mock(CreateHiveTableListener.class);
    when(createHiveTableListener.listen(any(WorkflowContext.class))).thenReturn(ListenerResult.success());
    when(createHiveTableListener.name()).thenReturn(CreateHiveTableListener.class.getSimpleName());
    when(createHiveTableListener.event()).thenReturn(TaskEvent.COMPLETE);
    taskListenerFactory.setCreateHiveTableListener(createHiveTableListener);
    PushSortConfigListener pushSortConfigListener = mock(PushSortConfigListener.class);
    when(pushSortConfigListener.listen(any(WorkflowContext.class))).thenReturn(ListenerResult.success());
    when(pushSortConfigListener.name()).thenReturn(PushSortConfigListener.class.getSimpleName());
    when(pushSortConfigListener.event()).thenReturn(TaskEvent.COMPLETE);
    taskListenerFactory.setPushSortConfigListener(pushSortConfigListener);
    taskListenerFactory.clearListeners();
    taskListenerFactory.init();
}
Also used : CreateHiveTableListener(org.apache.inlong.manager.service.thirdparty.hive.CreateHiveTableListener) CreateTubeTopicTaskListener(org.apache.inlong.manager.service.thirdparty.mq.CreateTubeTopicTaskListener) WorkflowContext(org.apache.inlong.manager.workflow.WorkflowContext) CreatePulsarGroupTaskListener(org.apache.inlong.manager.service.thirdparty.mq.CreatePulsarGroupTaskListener) CreateTubeGroupTaskListener(org.apache.inlong.manager.service.thirdparty.mq.CreateTubeGroupTaskListener) CreatePulsarResourceTaskListener(org.apache.inlong.manager.service.thirdparty.mq.CreatePulsarResourceTaskListener) PushSortConfigListener(org.apache.inlong.manager.service.thirdparty.sort.PushSortConfigListener)

Aggregations

CreateHiveTableListener (org.apache.inlong.manager.service.thirdparty.hive.CreateHiveTableListener)1 CreatePulsarGroupTaskListener (org.apache.inlong.manager.service.thirdparty.mq.CreatePulsarGroupTaskListener)1 CreatePulsarResourceTaskListener (org.apache.inlong.manager.service.thirdparty.mq.CreatePulsarResourceTaskListener)1 CreateTubeGroupTaskListener (org.apache.inlong.manager.service.thirdparty.mq.CreateTubeGroupTaskListener)1 CreateTubeTopicTaskListener (org.apache.inlong.manager.service.thirdparty.mq.CreateTubeTopicTaskListener)1 PushSortConfigListener (org.apache.inlong.manager.service.thirdparty.sort.PushSortConfigListener)1 WorkflowContext (org.apache.inlong.manager.workflow.WorkflowContext)1