use of org.apache.beam.runners.direct.WatermarkManager.TimerUpdate.TimerUpdateBuilder in project beam by apache.
the class WatermarkManagerTest method timerUpdateBuilderWithDeleteThenSetHasOnlySet.
@Test
public void timerUpdateBuilderWithDeleteThenSetHasOnlySet() {
TimerUpdateBuilder builder = TimerUpdate.builder(null);
TimerData timer = TimerData.of(StateNamespaces.global(), Instant.now(), TimeDomain.EVENT_TIME);
TimerUpdate built = builder.deletedTimer(timer).setTimer(timer).build();
assertThat(built.getSetTimers(), contains(timer));
assertThat(built.getDeletedTimers(), emptyIterable());
}
use of org.apache.beam.runners.direct.WatermarkManager.TimerUpdate.TimerUpdateBuilder in project beam by apache.
the class WatermarkManagerTest method timerUpdateBuilderWithDeleteAfterBuildNotAddedToBuilt.
@Test
public void timerUpdateBuilderWithDeleteAfterBuildNotAddedToBuilt() {
TimerUpdateBuilder builder = TimerUpdate.builder(null);
TimerData timer = TimerData.of(StateNamespaces.global(), Instant.now(), TimeDomain.EVENT_TIME);
TimerUpdate built = builder.build();
builder.deletedTimer(timer);
assertThat(built.getDeletedTimers(), emptyIterable());
builder.build();
assertThat(built.getDeletedTimers(), emptyIterable());
}
use of org.apache.beam.runners.direct.WatermarkManager.TimerUpdate.TimerUpdateBuilder in project beam by apache.
the class WatermarkManagerTest method timerUpdateBuilderWithSetThenDeleteHasOnlyDeleted.
@Test
public void timerUpdateBuilderWithSetThenDeleteHasOnlyDeleted() {
TimerUpdateBuilder builder = TimerUpdate.builder(null);
TimerData timer = TimerData.of(StateNamespaces.global(), Instant.now(), TimeDomain.EVENT_TIME);
TimerUpdate built = builder.setTimer(timer).deletedTimer(timer).build();
assertThat(built.getSetTimers(), emptyIterable());
assertThat(built.getDeletedTimers(), contains(timer));
}
Aggregations