@Test public void testListLeasesHandlesTimeout() throws Exception { TimeoutException te = setRuleForDependencyTimeout(); when(mockScanFuture.get(anyLong(), any(TimeUnit.class))).thenThrow(te); when(dynamoDbClient.scan(any(ScanRequest.class))).thenReturn(mockScanFuture); verifyCancel(mockScanFuture, () -> leaseRefresher.listLeases()); }
@Override public List<Lease> listLeases() throws DependencyException, InvalidStateException, ProvisionedThroughputException { return list(null, null); }
DynamoDBLeaseRefresher implements LeaseRefresher { @Override public List<Lease> listLeases() throws DependencyException, InvalidStateException, ProvisionedThroughputException { return list(null, null); } }
DynamoDBLeaseRefresher implements LeaseRefresher { @Override public List<Lease> listLeases() throws DependencyException, InvalidStateException, ProvisionedThroughputException { return list(null, null); } @Deprecated  DynamoDBLeaseRefresher(final String table, final DynamoDbAsyncClient dynamoDBClient,
            final LeaseSerializer serializer, final boolean consistentReads); @Deprecated  DynamoDBLeaseRefresher(final String table, final DynamoDbAsyncClient dynamoDBClient,
                                  final LeaseSerializer serializer, final boolean consistentReads,
                                  @NonNull final TableCreatorCallback tableCreatorCallback); @Deprecated  DynamoDBLeaseRefresher(final String table, final DynamoDbAsyncClient dynamoDBClient,
                                  final LeaseSerializer serializer, final boolean consistentReads,
                                  @NonNull final TableCreatorCallback tableCreatorCallback, Duration dynamoDbRequestTimeout);  DynamoDBLeaseRefresher(final String table, final DynamoDbAsyncClient dynamoDBClient,
                                  final LeaseSerializer serializer, final boolean consistentReads,
                                  @NonNull final TableCreatorCallback tableCreatorCallback, Duration dynamoDbRequestTimeout,
                                  final BillingMode billingMode); }
DynamoDBLeaseRefresher implements LeaseRefresher { @Override public List<Lease> listLeases() throws DependencyException, InvalidStateException, ProvisionedThroughputException { return list(null, null); } @Deprecated  DynamoDBLeaseRefresher(final String table, final DynamoDbAsyncClient dynamoDBClient,
            final LeaseSerializer serializer, final boolean consistentReads); @Deprecated  DynamoDBLeaseRefresher(final String table, final DynamoDbAsyncClient dynamoDBClient,
                                  final LeaseSerializer serializer, final boolean consistentReads,
                                  @NonNull final TableCreatorCallback tableCreatorCallback); @Deprecated  DynamoDBLeaseRefresher(final String table, final DynamoDbAsyncClient dynamoDBClient,
                                  final LeaseSerializer serializer, final boolean consistentReads,
                                  @NonNull final TableCreatorCallback tableCreatorCallback, Duration dynamoDbRequestTimeout);  DynamoDBLeaseRefresher(final String table, final DynamoDbAsyncClient dynamoDBClient,
                                  final LeaseSerializer serializer, final boolean consistentReads,
                                  @NonNull final TableCreatorCallback tableCreatorCallback, Duration dynamoDbRequestTimeout,
                                  final BillingMode billingMode); @Override boolean createLeaseTableIfNotExists(@NonNull final Long readCapacity, @NonNull final Long writeCapacity); @Override boolean leaseTableExists(); @Override boolean waitUntilLeaseTableExists(long secondsBetweenPolls, long timeoutSeconds); @Override List<Lease> listLeasesForStream(StreamIdentifier streamIdentifier); @Override List<Lease> listLeases(); @Override boolean isLeaseTableEmpty(); @Override boolean createLeaseIfNotExists(@NonNull final Lease lease); @Override Lease getLease(@NonNull final String leaseKey); @Override boolean renewLease(@NonNull final Lease lease); @Override boolean takeLease(@NonNull final Lease lease, @NonNull final String owner); @Override boolean evictLease(@NonNull final Lease lease); void deleteAll(); @Override void deleteLease(@NonNull final Lease lease); @Override boolean updateLease(@NonNull final Lease lease); @Override void updateLeaseWithMetaInfo(Lease lease, UpdateField updateField); @Override ExtendedSequenceNumber getCheckpoint(String leaseKey); }
DynamoDBLeaseRefresher implements LeaseRefresher { @Override public List<Lease> listLeases() throws DependencyException, InvalidStateException, ProvisionedThroughputException { return list(null, null); } @Deprecated  DynamoDBLeaseRefresher(final String table, final DynamoDbAsyncClient dynamoDBClient,
            final LeaseSerializer serializer, final boolean consistentReads); @Deprecated  DynamoDBLeaseRefresher(final String table, final DynamoDbAsyncClient dynamoDBClient,
                                  final LeaseSerializer serializer, final boolean consistentReads,
                                  @NonNull final TableCreatorCallback tableCreatorCallback); @Deprecated  DynamoDBLeaseRefresher(final String table, final DynamoDbAsyncClient dynamoDBClient,
                                  final LeaseSerializer serializer, final boolean consistentReads,
                                  @NonNull final TableCreatorCallback tableCreatorCallback, Duration dynamoDbRequestTimeout);  DynamoDBLeaseRefresher(final String table, final DynamoDbAsyncClient dynamoDBClient,
                                  final LeaseSerializer serializer, final boolean consistentReads,
                                  @NonNull final TableCreatorCallback tableCreatorCallback, Duration dynamoDbRequestTimeout,
                                  final BillingMode billingMode); @Override boolean createLeaseTableIfNotExists(@NonNull final Long readCapacity, @NonNull final Long writeCapacity); @Override boolean leaseTableExists(); @Override boolean waitUntilLeaseTableExists(long secondsBetweenPolls, long timeoutSeconds); @Override List<Lease> listLeasesForStream(StreamIdentifier streamIdentifier); @Override List<Lease> listLeases(); @Override boolean isLeaseTableEmpty(); @Override boolean createLeaseIfNotExists(@NonNull final Lease lease); @Override Lease getLease(@NonNull final String leaseKey); @Override boolean renewLease(@NonNull final Lease lease); @Override boolean takeLease(@NonNull final Lease lease, @NonNull final String owner); @Override boolean evictLease(@NonNull final Lease lease); void deleteAll(); @Override void deleteLease(@NonNull final Lease lease); @Override boolean updateLease(@NonNull final Lease lease); @Override void updateLeaseWithMetaInfo(Lease lease, UpdateField updateField); @Override ExtendedSequenceNumber getCheckpoint(String leaseKey);  }