ibm_cloud_sdk_core 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 632fa6196faf266c004867a8002a4dc159aa652d9dd26144975a987cb9b0e7c0
4
- data.tar.gz: 4d555fd04a96095a72e01dd78be693c66bb0e04e36f4307ee211042256960fe8
3
+ metadata.gz: 3aa7649a46616ff68df78f31bb96e4e3f446dbbb860de733539ae0fe33198be2
4
+ data.tar.gz: e277e383682e0e00ab70626e08a02484ebcac0e0fdddb75a4328203308b2dbc7
5
5
  SHA512:
6
- metadata.gz: bea320e17520b61c97bd2b48cb230a401fed62476749250779622598d5a40242f1b186fafee50e4829257d356b528b536c78010f389073e731619589ab985f22
7
- data.tar.gz: 106b79e7a30871c74c84ad47ae8d17cbaa306dd98dc1174f06a23a471865cea42954d06030fd301174cac7ab868fdd76abd19db54bb4840eca47103b1b3e58f8
6
+ metadata.gz: 1c88b1408600c23b95e93d9b236b2b7f1befefebce6c3af01c406a6d9cf8ee5ed319011ca7ee50ec7be3fd06a9d5e867ab41d3074181fa1a00b0b1f8ad115e12
7
+ data.tar.gz: 102d3450e5019d17efe1217e3d6c21a74dd4883690aba3bc8784995beb5609b61661bf177f6b0a978f92ae5f20560a45bac35996018b61f43c6b6663963819b6
@@ -26,8 +26,8 @@ module IBMCloudSdkCore
26
26
  @info = info
27
27
  # :nocov:
28
28
  end
29
- @transaction_id = transaction_id
30
- @global_transaction_id = global_transaction_id
29
+ @transaction_id = transaction_id || response.headers["X-Dp-Watson-Tran-Id"]
30
+ @global_transaction_id = global_transaction_id || response.headers["X-Global-Transaction-Id"]
31
31
  end
32
32
 
33
33
  def to_s
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IBMCloudSdkCore
4
- VERSION = "1.1.0"
4
+ VERSION = "1.1.1"
5
5
  end
@@ -163,15 +163,15 @@ class BaseServiceTest < Minitest::Test
163
163
  authenticator = IBMCloudSdkCore::BearerTokenAuthenticator.new(bearer_token: "token")
164
164
  service = IBMCloudSdkCore::BaseService.new(
165
165
  service_name: "assistant",
166
- authenticator: authenticator,
167
- service_url: "https://gateway.watsonplatform.net/"
166
+ authenticator: authenticator
168
167
  )
168
+ service.service_url = "https://gateway.watsonplatform.net/assistant/api/"
169
169
  form_data = {}
170
170
  file = File.open(Dir.getwd + "/resources/cnc_test.pdf")
171
171
  filename = file.path if filename.nil? && file.respond_to?(:path)
172
172
  form_data[:file] = HTTP::FormData::File.new(file, content_type: "application/octet-stream", filename: filename)
173
173
 
174
- stub_request(:post, "https://gateway.watsonplatform.net/").with do |req|
174
+ stub_request(:post, "https://gateway.watsonplatform.net/assistant/api/dummy/endpoint").with do |req|
175
175
  # Test the headers.
176
176
  assert_equal(req.headers["Accept"], "application/json")
177
177
  assert_match(%r{\Amultipart/form-data}, req.headers["Content-Type"])
@@ -180,7 +180,7 @@ class BaseServiceTest < Minitest::Test
180
180
  method: "POST",
181
181
  form: form_data,
182
182
  headers: { "Accept" => "application/json" },
183
- url: ""
183
+ url: "dummy/endpoint"
184
184
  )
185
185
  end
186
186
 
@@ -217,7 +217,8 @@ class BaseServiceTest < Minitest::Test
217
217
  stub_request(:get, "https://we.the.best/music")
218
218
  .with(
219
219
  headers: {
220
- "Host" => "we.the.best"
220
+ "Host" => "we.the.best",
221
+ "Authorization" => "Basic YXBpa2V5OmljcC14eXo="
221
222
  }
222
223
  ).to_return(status: 200, body: response.to_json, headers: headers)
223
224
  authenticator = IBMCloudSdkCore::BasicAuthenticator.new(
@@ -226,9 +227,9 @@ class BaseServiceTest < Minitest::Test
226
227
  )
227
228
  service = IBMCloudSdkCore::BaseService.new(
228
229
  service_name: "assistant",
229
- authenticator: authenticator,
230
- service_url: "https://we.the.best"
230
+ authenticator: authenticator
231
231
  )
232
+ service.service_url = "https://we.the.best"
232
233
  service_response = service.request(method: "GET", url: "/music", headers: {})
233
234
  assert_equal(response, service_response.result)
234
235
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibm_cloud_sdk_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mamoon Raja
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-15 00:00:00.000000000 Z
11
+ date: 2020-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby