Skip to content

Commit

Permalink
fix: Ensure endpoints are correct for mixin clients
Browse files Browse the repository at this point in the history
  • Loading branch information
dazuma committed Jan 12, 2024
1 parent 5d7f27f commit 419de0d
Show file tree
Hide file tree
Showing 1,983 changed files with 20,604 additions and 5,009 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ def universe_domain
@client_stub.universe_domain
end

##
# The effective endpoint
#
# @return [String]
#
def endpoint
@client_stub.endpoint
end

##
# Baseline implementation for the get_account REST call
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,19 @@
require "google/analytics/admin/v1alpha/analytics_admin_service"

class ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::ClientPathsTest < Minitest::Test
class DummyStub
def endpoint
"endpoint.example.com"
end

def universe_domain
"example.com"
end
end

def test_access_binding_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -40,7 +50,7 @@ def test_access_binding_path

def test_account_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -52,7 +62,7 @@ def test_account_path

def test_ad_sense_link_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -64,7 +74,7 @@ def test_ad_sense_link_path

def test_attribution_settings_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -76,7 +86,7 @@ def test_attribution_settings_path

def test_audience_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -88,7 +98,7 @@ def test_audience_path

def test_big_query_link_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -100,7 +110,7 @@ def test_big_query_link_path

def test_channel_group_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -112,7 +122,7 @@ def test_channel_group_path

def test_conversion_event_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -124,7 +134,7 @@ def test_conversion_event_path

def test_custom_dimension_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -136,7 +146,7 @@ def test_custom_dimension_path

def test_custom_metric_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -148,7 +158,7 @@ def test_custom_metric_path

def test_data_redaction_settings_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -160,7 +170,7 @@ def test_data_redaction_settings_path

def test_data_retention_settings_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -172,7 +182,7 @@ def test_data_retention_settings_path

def test_data_sharing_settings_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -184,7 +194,7 @@ def test_data_sharing_settings_path

def test_data_stream_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -196,7 +206,7 @@ def test_data_stream_path

def test_display_video360_advertiser_link_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -208,7 +218,7 @@ def test_display_video360_advertiser_link_path

def test_display_video360_advertiser_link_proposal_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -220,7 +230,7 @@ def test_display_video360_advertiser_link_proposal_path

def test_enhanced_measurement_settings_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -232,7 +242,7 @@ def test_enhanced_measurement_settings_path

def test_event_create_rule_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -244,7 +254,7 @@ def test_event_create_rule_path

def test_expanded_data_set_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -256,7 +266,7 @@ def test_expanded_data_set_path

def test_firebase_link_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -268,7 +278,7 @@ def test_firebase_link_path

def test_global_site_tag_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -280,7 +290,7 @@ def test_global_site_tag_path

def test_google_ads_link_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -292,7 +302,7 @@ def test_google_ads_link_path

def test_google_signals_settings_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -304,7 +314,7 @@ def test_google_signals_settings_path

def test_measurement_protocol_secret_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -316,7 +326,7 @@ def test_measurement_protocol_secret_path

def test_property_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -328,7 +338,7 @@ def test_property_path

def test_rollup_property_source_link_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -340,7 +350,7 @@ def test_rollup_property_source_link_path

def test_sk_ad_network_conversion_value_schema_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -352,7 +362,7 @@ def test_sk_ad_network_conversion_value_schema_path

def test_search_ads360_link_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand All @@ -364,7 +374,7 @@ def test_search_ads360_link_path

def test_subproperty_event_filter_path
grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure
::Gapic::ServiceStub.stub :new, nil do
::Gapic::ServiceStub.stub :new, DummyStub.new do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ def make_http_request *args, **kwargs

@response
end

def endpoint
"endpoint.example.com"
end

def universe_domain
"example.com"
end
end

def test_get_account
Expand Down Expand Up @@ -7258,7 +7266,8 @@ def test_configure
credentials_token = :dummy_value

client = block_config = config = nil
Gapic::Rest::ClientStub.stub :new, nil do
dummy_stub = ClientStub.new nil
Gapic::Rest::ClientStub.stub :new, dummy_stub do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Rest::Client.new do |config|
config.credentials = credentials_token
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs

@response
end

def endpoint
"endpoint.example.com"
end

def universe_domain
"example.com"
end
end

def test_get_account
Expand Down Expand Up @@ -8005,7 +8013,8 @@ def test_configure
grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure

client = block_config = config = nil
Gapic::ServiceStub.stub :new, nil do
dummy_stub = ClientStub.new nil, nil
Gapic::ServiceStub.stub :new, dummy_stub do
client = ::Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new do |config|
config.credentials = grpc_channel
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ def universe_domain
@client_stub.universe_domain
end

##
# The effective endpoint
#
# @return [String]
#
def endpoint
@client_stub.endpoint
end

##
# Baseline implementation for the run_report REST call
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ def call_rpc *args, **kwargs

@response
end

def endpoint
"endpoint.example.com"
end

def universe_domain
"example.com"
end
end

def test_list_operations
Expand Down Expand Up @@ -364,7 +372,8 @@ def test_configure
grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure

client = block_config = config = nil
Gapic::ServiceStub.stub :new, nil do
dummy_stub = ClientStub.new nil, nil
Gapic::ServiceStub.stub :new, dummy_stub do
client = ::Google::Analytics::Data::V1beta::AnalyticsData::Operations.new do |config|
config.credentials = grpc_channel
end
Expand Down
Loading

0 comments on commit 419de0d

Please sign in to comment.