Search in sources :

Example 1 with ConjureUnlockRequest

use of com.palantir.atlasdb.timelock.api.ConjureUnlockRequest in project atlasdb by palantir.

the class LockLeaseServiceTest method before.

@Before
public void before() {
    when(lockRequest.getAcquireTimeoutMs()).thenReturn(10L);
    when(timelock.leaderTime()).thenAnswer(inv -> LeaderTime.of(LEADER_ID, time.get()));
    when(timelock.unlock(any())).thenAnswer(inv -> {
        ConjureUnlockRequest request = inv.getArgument(0);
        return ConjureUnlockResponse.of(request.getTokens());
    });
    lockLeaseService = new LockLeaseService(timelock, SERVICE_ID, new LegacyLeaderTimeGetter(timelock));
}
Also used : ConjureUnlockRequest(com.palantir.atlasdb.timelock.api.ConjureUnlockRequest) Before(org.junit.Before)

Aggregations

ConjureUnlockRequest (com.palantir.atlasdb.timelock.api.ConjureUnlockRequest)1 Before (org.junit.Before)1