Search in sources :

Example 1 with ProcessService

use of pipelite.service.ProcessService in project pipelite by enasequence.

the class ProcessEntityCreatorTest method test.

@Test
public void test() {
    TestPipeline testPipeline = new TestPipeline();
    ProcessService service = mock(ProcessService.class);
    ProcessEntityCreator creator = spy(new ProcessEntityCreator(testPipeline, service));
    when(service.createExecution(any(), any(), any())).thenAnswer(invocation -> {
        String pipelineName = invocation.getArgument(0);
        String processId = invocation.getArgument(1);
        return processEntity(pipelineName, processId);
    });
    assertThat(creator.create(PROCESS_CNT)).isEqualTo(PROCESS_CNT);
    assertThat(testPipeline.confirmedProcessCount()).isEqualTo(PROCESS_CNT);
}
Also used : ConfigurableTestPipeline(pipelite.tester.pipeline.ConfigurableTestPipeline) ProcessService(pipelite.service.ProcessService) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 ProcessService (pipelite.service.ProcessService)1 ConfigurableTestPipeline (pipelite.tester.pipeline.ConfigurableTestPipeline)1