public synchronized void executeDdlStatement(String statement) throws IllegalStateException {
    checkIsUsable();
    maybeCreateInstance();
    maybeCreateDatabase();

    LOG.info("Executing DDL statement '{}' on database {}.", statement, databaseId);
    try {
      databaseAdminClient
          .updateDatabaseDdl(
              instanceId, databaseId, ImmutableList.of(statement), /* operationId= */ null)
          .get();
      LOG.info("Successfully executed DDL statement '{}' on database {}.", statement, databaseId);
    } catch (ExecutionException | InterruptedException | SpannerException e) {
      throw new SpannerResourceManagerException("Failed to execute statement.", e);
    }
  }
@Test
  public void testExecuteDdlStatementShouldThrowExceptionWhenSpannerCreateInstanceFails()
      throws ExecutionException, InterruptedException {
    // arrange
    when(spanner.getInstanceAdminClient().createInstance(any()).get())
        .thenThrow(InterruptedException.class);
    prepareCreateDatabaseMock();
    prepareUpdateDatabaseMock();
    String statement =
        "CREATE TABLE Singers (\n"
            + "  SingerId   INT64 NOT NULL,\n"
            + "  FirstName  STRING(1024),\n"
            + "  LastName   STRING(1024),\n"
            + ") PRIMARY KEY (SingerId)";

    // act & assert
    assertThrows(
        SpannerResourceManagerException.class, () -> testManager.executeDdlStatement(statement));
  }