use of com.palantir.lock.watch.LockWatchStateUpdate in project atlasdb by palantir.
the class LockWatchingServiceImplTest method assertLoggedEvents.
private void assertLoggedEvents(List<LockWatchEvent> expectedEvents) {
LockWatchStateUpdate update = lockWatcher.getWatchStateUpdate(Optional.of(LockWatchVersion.of(LOG_ID, -1L)));
List<LockWatchEvent> events = UpdateVisitors.assertSuccess(update).events();
assertThat(events).containsExactlyElementsOf(expectedEvents);
}
use of com.palantir.lock.watch.LockWatchStateUpdate in project atlasdb by palantir.
the class LockWatchEventCacheIntegrationTest method newEventsStartingWithTheSameVersionAsCurrentDoesNotThrow.
@Test
public void newEventsStartingWithTheSameVersionAsCurrentDoesNotThrow() {
setupInitialState();
LockWatchEvent earlyLockEvent = LockWatchCreatedEvent.builder(ImmutableSet.of(REFERENCE), ImmutableSet.of(DESCRIPTOR)).build(3L);
LockWatchStateUpdate success = LockWatchStateUpdate.success(LEADER, 4L, ImmutableList.of(earlyLockEvent, WATCH_EVENT));
assertThatCode(() -> eventCache.processStartTransactionsUpdate(TIMESTAMPS_2, success)).doesNotThrowAnyException();
}
use of com.palantir.lock.watch.LockWatchStateUpdate in project atlasdb by palantir.
the class AsyncLockServiceEteTest method leaderIdFromLockWatchingServiceIsSameAsLeaderClock.
@Test
public void leaderIdFromLockWatchingServiceIsSameAsLeaderClock() {
LeaderTime leaderTime = service.leaderTime();
LockWatchStateUpdate lockWatchUpdate = lockWatchingService.getWatchStateUpdate(Optional.empty());
assertThat(leaderTime.id().id()).isEqualTo(lockWatchUpdate.logId());
}
Aggregations