use of com.palantir.lock.LockRequest.Builder in project atlasdb by palantir.
the class LockRefreshingLockServiceTest method testSimpleRefresh.
@Test
public void testSimpleRefresh() throws InterruptedException {
Builder builder = LockRequest.builder(ImmutableSortedMap.of(lock1, LockMode.WRITE));
builder.timeoutAfter(SimpleTimeDuration.of(5, TimeUnit.SECONDS));
LockResponse lock = server.lockWithFullLockResponse(LockClient.ANONYMOUS, builder.build());
Thread.sleep(10000);
Set<HeldLocksToken> refreshTokens = server.refreshTokens(ImmutableList.of(lock.getToken()));
Assert.assertEquals(1, refreshTokens.size());
}
Aggregations