use of io.automatiko.engine.services.event.impl.ProcessInstanceEventBatch in project automatiko-engine by automatiko-io.
the class ProcessInstanceEventBatchTest method testMilestones.
@Test
public void testMilestones() {
ProcessInstanceEventBatch batch = new ProcessInstanceEventBatch(null, null);
WorkflowProcessInstance pi = mock(WorkflowProcessInstance.class);
when(pi.milestones()).thenReturn(null);
assertThat(batch.createMilestones(pi)).isNull();
when(pi.milestones()).thenReturn(emptyList());
assertThat(batch.createMilestones(pi)).isEmpty();
Milestone milestone = Milestone.builder().withId("id").withName("name").withStatus(Status.AVAILABLE).build();
when(pi.milestones()).thenReturn(singleton(milestone));
MilestoneEventBody milestoneEventBody = MilestoneEventBody.create().id("id").name("name").status(Status.AVAILABLE.name()).build();
assertThat(batch.createMilestones(pi)).containsOnly(milestoneEventBody);
}
use of io.automatiko.engine.services.event.impl.ProcessInstanceEventBatch in project automatiko-engine by automatiko-io.
the class ProcessInstanceEventBatchTest method testNoProcessIdDefined.
@Test
public void testNoProcessIdDefined() {
ProcessInstanceEventBatch batch = new ProcessInstanceEventBatch("http://localhost:8080", null);
assertThat(batch.extractRuntimeSource(emptyMap())).isNull();
}
use of io.automatiko.engine.services.event.impl.ProcessInstanceEventBatch in project automatiko-engine by automatiko-io.
the class ProcessInstanceEventBatchTest method testNoServiceDefined.
@Test
public void testNoServiceDefined() {
ProcessInstanceEventBatch batch = new ProcessInstanceEventBatch("", null);
assertThat(batch.extractRuntimeSource(singletonMap(PROCESS_ID_META_DATA, "travels"))).isEqualTo("/travels");
assertThat(batch.extractRuntimeSource(singletonMap(PROCESS_ID_META_DATA, "demo.orders"))).isEqualTo("/orders");
}
use of io.automatiko.engine.services.event.impl.ProcessInstanceEventBatch in project automatiko-engine by automatiko-io.
the class ProcessInstanceEventBatchTest method testServiceDefined.
@Test
public void testServiceDefined() {
ProcessInstanceEventBatch batch = new ProcessInstanceEventBatch("http://localhost:8080", null);
assertThat(batch.extractRuntimeSource(singletonMap(PROCESS_ID_META_DATA, "travels"))).isEqualTo("http://localhost:8080/travels");
assertThat(batch.extractRuntimeSource(singletonMap(PROCESS_ID_META_DATA, "demo.orders"))).isEqualTo("http://localhost:8080/orders");
}
Aggregations