use of com.palantir.lock.client.LeasedLockToken in project atlasdb by palantir.
the class ClientLogEventsTest method toCommitUpdateFiltersOutLockEventsWithMatchingLockToken.
@Test
public void toCommitUpdateFiltersOutLockEventsWithMatchingLockToken() {
// due to how the commit flow works, the filtering is only done if it is a leased lock token
LeasedLockToken leasedLockToken = mock(LeasedLockToken.class);
when(leasedLockToken.serverToken()).thenReturn(CONJURE_TOKEN_1);
TimestampStateStore.CommitInfo commitInfo = TimestampStateStore.CommitInfo.of(leasedLockToken, VERSION_1);
CommitUpdate commitUpdate = CLIENT_EVENTS_2_TO_4_NO_CLEAR_CACHE.toCommitUpdate(VERSION_1, VERSION_4, Optional.of(commitInfo));
Set<LockDescriptor> lockDescriptors = extractLockDescriptors(commitUpdate);
assertThat(lockDescriptors).containsExactlyInAnyOrder(DESCRIPTOR_1);
}
Aggregations