diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDatabaseAdminTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDatabaseAdminTest.java index 82bf2bd3f6bf..f4e994c79407 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDatabaseAdminTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDatabaseAdminTest.java @@ -164,13 +164,14 @@ public void listPagination() throws Exception { String instanceId = testHelper.getInstanceId().getInstance(); for (String dbId : dbIds) { - dbAdminClient.createDatabase(instanceId, dbId, ImmutableList.of()).waitFor(); + dbs.add(dbAdminClient.createDatabase(instanceId, dbId, ImmutableList.of()) + .waitFor() + .getResult()); } Page page = dbAdminClient.listDatabases(instanceId, Options.pageSize(1)); List dbIdsGot = new ArrayList<>(); while (page != null) { Database db = Iterables.getOnlyElement(page.getValues()); - dbs.add(db); dbIdsGot.add(db.getId().getDatabase()); page = page.getNextPage(); }