Skip to content

Commit 95e6ebf

Browse files
committed
fix tests to use Options
1 parent 8885d02 commit 95e6ebf

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

google/cloud/storage/oauth2/service_account_credentials_test.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "google/cloud/storage/testing/mock_http_request.h"
2020
#include "google/cloud/storage/testing/write_base64.h"
2121
#include "google/cloud/common_options.h"
22+
#include "google/cloud/credentials.h"
2223
#include "google/cloud/internal/base64_transforms.h"
2324
#include "google/cloud/internal/filesystem.h"
2425
#include "google/cloud/internal/random.h"
@@ -390,7 +391,7 @@ TEST_F(ServiceAccountCredentialsTest, UsesCARootsInfo) {
390391
});
391392

392393
ServiceAccountCredentials<MockHttpRequestBuilder, FakeClock> credentials(
393-
*info, ChannelOptions().set_ssl_root_path(cainfo));
394+
*info, Options{}.set<google::cloud::CARootsFilePathOption>(cainfo));
394395
// Call Refresh to obtain the access token for our authorization header.
395396
auto authorization_header = credentials.AuthorizationHeader();
396397
ASSERT_STATUS_OK(authorization_header);

google/cloud/storage/tests/create_client_integration_test.cc

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,9 @@ class CreateClientIntegrationTest
6666
#include "google/cloud/internal/disable_deprecation_warnings.inc"
6767

6868
TEST_F(CreateClientIntegrationTest, DefaultWorks) {
69-
auto client = Client::CreateDefaultClient();
70-
ASSERT_THAT(client, IsOk());
69+
auto client = Client(Options{});
7170
ASSERT_NO_FATAL_FAILURE(
72-
UseClient(*client, bucket_name(), MakeRandomObjectName(), LoremIpsum()));
71+
UseClient(client, bucket_name(), MakeRandomObjectName(), LoremIpsum()));
7372
}
7473

7574
TEST_F(CreateClientIntegrationTest, SettingPolicies) {
@@ -79,24 +78,20 @@ TEST_F(CreateClientIntegrationTest, SettingPolicies) {
7978
ASSERT_THAT(c, IsOk());
8079
credentials = *std::move(c);
8180
}
82-
auto client =
83-
Client(Options{}),
84-
LimitedErrorCountRetryPolicy(/*maximum_failures=*/5),
85-
ExponentialBackoffPolicy(/*initial_delay=*/std::chrono::seconds(1),
86-
/*maximum_delay=*/std::chrono::minutes(5),
87-
/*scaling=*/1.5));
81+
auto client = Client(
82+
Options{}
83+
.set<RetryPolicyOption>(
84+
LimitedErrorCountRetryPolicy(/*maximum_failures=*/5).clone())
85+
.set<BackoffPolicyOption>(
86+
ExponentialBackoffPolicy(
87+
/*initial_delay=*/std::chrono::seconds(1),
88+
/*maximum_delay=*/std::chrono::minutes(5),
89+
/*scaling=*/1.5)
90+
.clone()));
8891
ASSERT_NO_FATAL_FAILURE(
8992
UseClient(client, bucket_name(), MakeRandomObjectName(), LoremIpsum()));
9093
}
9194

92-
/// @test Verify the backwards compatibility `v1` namespace still exists.
93-
TEST_F(CreateClientIntegrationTest, BackwardsCompatibility) {
94-
auto client = Client(Options{});
95-
ASSERT_THAT(client, IsOk());
96-
ASSERT_NO_FATAL_FAILURE(
97-
UseClient(*client, bucket_name(), MakeRandomObjectName(), LoremIpsum()));
98-
}
99-
10095
} // namespace
10196
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
10297
} // namespace storage

0 commit comments

Comments
 (0)