test/plugin/base_test.rb in fluent-plugin-google-cloud-0.6.10.pre.2 vs test/plugin/base_test.rb in fluent-plugin-google-cloud-0.6.10
- old
+ new
@@ -60,21 +60,10 @@
exception_count += 1
end
assert_equal 1, exception_count
end
- def test_configure_logging_api_url
- setup_gce_metadata_stubs
- {
- APPLICATION_DEFAULT_CONFIG => DEFAULT_LOGGING_API_URL,
- CUSTOM_LOGGING_API_URL_CONFIG => CUSTOM_LOGGING_API_URL
- }.each do |(config, url)|
- d = create_driver(config)
- assert_equal url, d.instance.instance_variable_get(:@logging_api_url)
- end
- end
-
def test_configure_custom_metadata
setup_no_metadata_service_stubs
d = create_driver(CUSTOM_METADATA_CONFIG)
assert_equal CUSTOM_PROJECT_ID, d.instance.project_id
assert_equal CUSTOM_ZONE, d.instance.zone
@@ -1366,17 +1355,17 @@
headers: { 'Content-Length' => EC2_IDENTITY_DOCUMENT.length })
end
def setup_auth_stubs
# Used when loading credentials from a JSON file.
- stub_request(:post, 'https://www.googleapis.com/oauth2/v3/token')
+ stub_request(:post, 'https://www.googleapis.com/oauth2/v4/token')
.with(body: hash_including(grant_type: AUTH_GRANT_TYPE))
.to_return(body: %({"access_token": "#{FAKE_AUTH_TOKEN}"}),
status: 200,
headers: { 'Content-Length' => FAKE_AUTH_TOKEN.length,
'Content-Type' => 'application/json' })
- stub_request(:post, 'https://www.googleapis.com/oauth2/v3/token')
+ stub_request(:post, 'https://www.googleapis.com/oauth2/v4/token')
.with(body: hash_including(grant_type: 'refresh_token'))
.to_return(body: %({"access_token": "#{FAKE_AUTH_TOKEN}"}),
status: 200,
headers: { 'Content-Length' => FAKE_AUTH_TOKEN.length,
'Content-Type' => 'application/json' })