public void deletePartitionMetadataTable() {
    List<String> ddl = new ArrayList<>();
    if (this.isPostgres()) {
      ddl.add("DROP INDEX \"" + CREATED_AT_START_TIMESTAMP_INDEX + "\"");
      ddl.add("DROP INDEX \"" + WATERMARK_INDEX + "\"");
      ddl.add("DROP TABLE \"" + tableName + "\"");
    } else {
      ddl.add("DROP INDEX " + CREATED_AT_START_TIMESTAMP_INDEX);
      ddl.add("DROP INDEX " + WATERMARK_INDEX);
      ddl.add("DROP TABLE " + tableName);
    }
    OperationFuture<Void, UpdateDatabaseDdlMetadata> op =
        databaseAdminClient.updateDatabaseDdl(instanceId, databaseId, ddl, null);
    try {
      // Initiate the request which returns an OperationFuture.
      op.get(TIMEOUT_MINUTES, TimeUnit.MINUTES);
    } catch (ExecutionException | TimeoutException e) {
      // If the operation failed or timed out during execution, expose the cause.
      if (e.getCause() != null) {
        throw (SpannerException) e.getCause();
      } else {
        throw SpannerExceptionFactory.asSpannerException(e);
      }
    } catch (InterruptedException e) {
      // Throw when a thread is waiting, sleeping, or otherwise occupied,
      // and the thread is interrupted, either before or during the activity.
      throw SpannerExceptionFactory.propagateInterrupt(e);
    }
  }
@Test
  public void testDeletePartitionMetadataTableWithInterruptedException() throws Exception {
    when(op.get(10, TimeUnit.MINUTES)).thenThrow(new InterruptedException(INTERRUPTED));
    try {
      partitionMetadataAdminDao.deletePartitionMetadataTable();
      fail();
    } catch (SpannerException e) {
      assertEquals(ErrorCode.CANCELLED, e.getErrorCode());
      assertTrue(e.getMessage().contains(INTERRUPTED));
    }
  }