1313// limitations under the License.
1414
1515#include " google/cloud/storage/grpc_plugin.h"
16- #include " google/cloud/storage/internal/curl_client.h"
1716#include " google/cloud/storage/internal/grpc_client.h"
1817#include " google/cloud/storage/internal/hybrid_client.h"
18+ #include " google/cloud/storage/internal/rest_client.h"
1919#include " google/cloud/storage/internal/retry_client.h"
2020#include " google/cloud/testing_util/scoped_environment.h"
2121#include < gmock/gmock.h>
@@ -27,18 +27,15 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
2727namespace {
2828
2929using ::google::cloud::storage::internal::ClientImplDetails;
30- using ::google::cloud::storage::internal::CurlClient;
3130using ::google::cloud::storage::internal::GrpcClient;
3231using ::google::cloud::storage::internal::HybridClient;
32+ using ::google::cloud::storage::internal::RestClient;
3333using ::google::cloud::storage::internal::RetryClient;
3434using ::google::cloud::testing_util::ScopedEnvironment;
3535using ::testing::IsNull;
3636using ::testing::NotNull;
3737
3838TEST (GrpcPluginTest, MetadataConfigCreatesGrpc) {
39- // Explicitly disable the RestClient, which may be enabled by our CI builds.
40- auto rest =
41- ScopedEnvironment (" GOOGLE_CLOUD_CPP_STORAGE_USE_LEGACY_HTTP" , " yes" );
4239 // Explicitly disable logging, which may be enabled by our CI builds.
4340 auto logging =
4441 ScopedEnvironment (" CLOUD_STORAGE_ENABLE_TRACING" , absl::nullopt );
@@ -54,9 +51,6 @@ TEST(GrpcPluginTest, MetadataConfigCreatesGrpc) {
5451}
5552
5653TEST (GrpcPluginTest, EnvironmentOverrides) {
57- // Explicitly disable the RestClient, which may be enabled by our CI builds.
58- auto rest =
59- ScopedEnvironment (" GOOGLE_CLOUD_CPP_STORAGE_USE_LEGACY_HTTP" , " yes" );
6054 // Explicitly disable logging, which may be enabled by our CI builds.
6155 auto logging =
6256 ScopedEnvironment (" CLOUD_STORAGE_ENABLE_TRACING" , absl::nullopt );
@@ -71,9 +65,6 @@ TEST(GrpcPluginTest, EnvironmentOverrides) {
7165}
7266
7367TEST (GrpcPluginTest, UnsetConfigCreatesCurl) {
74- // Explicitly disable the RestClient, which may be enabled by our CI builds.
75- auto rest =
76- ScopedEnvironment (" GOOGLE_CLOUD_CPP_STORAGE_USE_LEGACY_HTTP" , " yes" );
7768 // Explicitly disable logging, which may be enabled by our CI builds.
7869 auto logging =
7970 ScopedEnvironment (" CLOUD_STORAGE_ENABLE_TRACING" , absl::nullopt );
@@ -83,14 +74,11 @@ TEST(GrpcPluginTest, UnsetConfigCreatesCurl) {
8374 auto const * const retry =
8475 dynamic_cast <RetryClient*>(ClientImplDetails::GetRawClient (client).get ());
8576 ASSERT_THAT (retry, NotNull ());
86- auto const * const curl = dynamic_cast <CurlClient *>(retry->client ().get ());
87- ASSERT_THAT (curl , NotNull ());
77+ auto const * const rest = dynamic_cast <RestClient *>(retry->client ().get ());
78+ ASSERT_THAT (rest , NotNull ());
8879}
8980
9081TEST (GrpcPluginTest, NoneConfigCreatesCurl) {
91- // Explicitly disable the RestClient, which may be enabled by our CI builds.
92- auto rest =
93- ScopedEnvironment (" GOOGLE_CLOUD_CPP_STORAGE_USE_LEGACY_HTTP" , " yes" );
9482 // Explicitly disable logging, which may be enabled by our CI builds.
9583 auto logging =
9684 ScopedEnvironment (" CLOUD_STORAGE_ENABLE_TRACING" , absl::nullopt );
@@ -100,14 +88,11 @@ TEST(GrpcPluginTest, NoneConfigCreatesCurl) {
10088 auto const * const retry =
10189 dynamic_cast <RetryClient*>(ClientImplDetails::GetRawClient (client).get ());
10290 ASSERT_THAT (retry, NotNull ());
103- auto const * const curl = dynamic_cast <CurlClient *>(retry->client ().get ());
104- ASSERT_THAT (curl , NotNull ());
91+ auto const * const rest = dynamic_cast <RestClient *>(retry->client ().get ());
92+ ASSERT_THAT (rest , NotNull ());
10593}
10694
10795TEST (GrpcPluginTest, MediaConfigCreatesHybrid) {
108- // Explicitly disable the RestClient, which may be enabled by our CI builds.
109- auto rest =
110- ScopedEnvironment (" GOOGLE_CLOUD_CPP_STORAGE_USE_LEGACY_HTTP" , " yes" );
11196 // Explicitly disable logging, which may be enabled by our CI builds.
11297 auto logging =
11398 ScopedEnvironment (" CLOUD_STORAGE_ENABLE_TRACING" , absl::nullopt );
0 commit comments