use of com.epam.pipeline.elasticsearchagent.model.PipelineEvent in project cloud-pipeline by epam.
the class EntitySynchronizerTest method testDeletedObjectMergeEvents.
@Test
void testDeletedObjectMergeEvents() {
List<PipelineEvent> pipelineEvents = new ArrayList<>();
PipelineEvent event1 = createEvent(EventType.INSERT, LocalDateTime.now(), PipelineEvent.ObjectType.RUN, 1L);
pipelineEvents.add(event1);
PipelineEvent event2 = createEvent(EventType.INSERT, LocalDateTime.now(), PipelineEvent.ObjectType.RUN, 2L);
pipelineEvents.add(event2);
PipelineEvent event3 = createEvent(EventType.UPDATE, LocalDateTime.now(), PipelineEvent.ObjectType.RUN, 1L);
pipelineEvents.add(event3);
PipelineEvent event4 = createEvent(EventType.DELETE, LocalDateTime.now(), PipelineEvent.ObjectType.RUN, 1L);
pipelineEvents.add(event4);
List<PipelineEvent> mergeEvents = EventProcessorUtils.mergeEvents(pipelineEvents);
assertEquals(2, mergeEvents.size());
}
use of com.epam.pipeline.elasticsearchagent.model.PipelineEvent in project cloud-pipeline by epam.
the class EntitySynchronizerTest method testUpdatedObjectMergeEvents.
@Test
void testUpdatedObjectMergeEvents() {
List<PipelineEvent> pipelineEvents = new ArrayList<>();
PipelineEvent event1 = createEvent(EventType.INSERT, LocalDateTime.now(), PipelineEvent.ObjectType.RUN, 1L);
pipelineEvents.add(event1);
PipelineEvent event2 = createEvent(EventType.INSERT, LocalDateTime.now(), PipelineEvent.ObjectType.RUN, 2L);
pipelineEvents.add(event2);
PipelineEvent event3 = createEvent(EventType.UPDATE, LocalDateTime.now(), PipelineEvent.ObjectType.RUN, 1L);
pipelineEvents.add(event3);
PipelineEvent event4 = createEvent(EventType.UPDATE, LocalDateTime.now(), PipelineEvent.ObjectType.RUN, 1L);
pipelineEvents.add(event4);
List<PipelineEvent> mergeEvents = EventProcessorUtils.mergeEvents(pipelineEvents);
assertEquals(2, mergeEvents.size());
}
Aggregations