Search in sources :

Example 1 with RefreshLockResponseV2

use of com.palantir.lock.v2.RefreshLockResponseV2 in project atlasdb by palantir.

the class AtlasBackupResourceTest method refreshesBackupSuccessfully.

@Test
public void refreshesBackupSuccessfully() {
    InProgressBackupToken inProgressBackupToken = validBackupToken();
    Set<LockToken> lockTokens = ImmutableSet.of(inProgressBackupToken.getLockToken());
    when(mockTimelock.refreshLockLeases(lockTokens)).thenReturn(Futures.immediateFuture(RefreshLockResponseV2.of(lockTokens, mock(Lease.class))));
    assertThat(AtlasFutures.getUnchecked(atlasBackupService.refreshBackup(AUTH_HEADER, refreshBackupRequest(inProgressBackupToken)))).isEqualTo(refreshBackupResponseWith(inProgressBackupToken));
    verify(authHeaderValidator).suppliedHeaderMatchesConfig(AUTH_HEADER);
}
Also used : Lease(com.palantir.lock.v2.Lease) LockToken(com.palantir.lock.v2.LockToken) InProgressBackupToken(com.palantir.atlasdb.backup.api.InProgressBackupToken) Test(org.junit.Test)

Aggregations

InProgressBackupToken (com.palantir.atlasdb.backup.api.InProgressBackupToken)1 Lease (com.palantir.lock.v2.Lease)1 LockToken (com.palantir.lock.v2.LockToken)1 Test (org.junit.Test)1