Skip to content

Commit

Permalink
cleanup(mixin): add integration tests (#14829)
Browse files Browse the repository at this point in the history
* cleanup(mixin): add integration tests

* fix

* format
  • Loading branch information
cuiy0006 authored Nov 12, 2024
1 parent 94f34a7 commit b9dbb55
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,25 @@ TEST_F(DatabaseAdminClientTest, LROStartAwait) {
EXPECT_FALSE(DatabaseExists()) << "Database " << database_;
}

/// @test Verify the LRO Mixin method GetOperation.
TEST_F(DatabaseAdminClientTest, LROMixin) {
auto operation = client_.CreateDatabase(
NoAwaitTag{}, database_.instance().FullName(),
absl::StrCat("CREATE DATABASE `", database_.database_id(), "`"));
ASSERT_STATUS_OK(operation);

auto get_operation = client_.GetOperation(operation->name());
ASSERT_STATUS_OK(get_operation);

EXPECT_EQ(get_operation->name(), operation->name());

(void)client_.CreateDatabase(*operation).get();
EXPECT_TRUE(DatabaseExists()) << "Database " << database_;
auto drop_status = client_.DropDatabase(database_.FullName());
EXPECT_STATUS_OK(drop_status);
EXPECT_FALSE(DatabaseExists()) << "Database " << database_;
}

} // namespace
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace spanner
Expand Down

0 comments on commit b9dbb55

Please sign in to comment.