api_client 0.5.26-java → 0.6.0-java
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/api_client/connection/basic.rb +1 -1
- data/lib/api_client/version.rb +1 -1
- data/spec/api_client/connection/basic_spec.rb +7 -7
- data/spec/api_client/connection/oauth_spec.rb +9 -13
- metadata +17 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 861da114f0da9d319e5e08c020e4c07f29299fb111975feeec2b926142f7d1f5
|
4
|
+
data.tar.gz: f4faf72c964e354f05ff9bafe9da81385f749453130c21877081cf3b73dae220
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c928fcc0591ec30b435c8e135b583228e302282031dcc5c8122f7edcd3987010ddb43b8954b3c169a89e77a43d50ce4e898c0c3ec1ea93b539b85f1bf3c94d39
|
7
|
+
data.tar.gz: 1601de7481ad45bbdce864ec4291197721b222dafbc0b119dd739a26fc38ece6a96a728b40f038809ae886fb89498328a699245b901a798f703a9a2d23a3051c
|
data/CHANGELOG.md
CHANGED
@@ -88,7 +88,7 @@ module ApiClient
|
|
88
88
|
response = @handler.send(method, path, data, headers)
|
89
89
|
request = { :method => method, :path => path, :data => data}
|
90
90
|
handle_response(request, response)
|
91
|
-
rescue Faraday::
|
91
|
+
rescue Faraday::ConnectionFailed => e
|
92
92
|
raise ApiClient::Errors::ConnectionFailed.new(e.message, request, response)
|
93
93
|
end
|
94
94
|
|
data/lib/api_client/version.rb
CHANGED
@@ -7,21 +7,21 @@ describe ApiClient::Connection::Basic do
|
|
7
7
|
instance.inspect.should == '#<ApiClient::Connection::Basic endpoint: "http://google.com">'
|
8
8
|
end
|
9
9
|
|
10
|
+
it "uses correct adapter" do
|
11
|
+
instance = ApiClient::Connection::Basic.new("http://google.com")
|
12
|
+
expect(instance.handler.builder.adapter.name).to eq("Faraday::Adapter::NetHttp")
|
13
|
+
end
|
14
|
+
|
10
15
|
it "adds basic middlewares to faraday" do
|
11
16
|
instance = ApiClient::Connection::Basic.new("http://google.com")
|
12
|
-
instance.handler.builder.handlers.collect(&:name).
|
17
|
+
expect(instance.handler.builder.handlers.collect(&:name)).to include("Faraday::Request::UrlEncoded")
|
13
18
|
end
|
14
19
|
|
15
20
|
it "adds the logger middlewares to faraday if ApiClient.logger is available" do
|
16
21
|
logger = double
|
17
22
|
ApiClient.stub(:logger).and_return(logger)
|
18
23
|
instance = ApiClient::Connection::Basic.new("http://google.com")
|
19
|
-
instance.handler.builder.handlers.collect(&:name).
|
20
|
-
"ApiClient::Connection::Middlewares::Request::Logger",
|
21
|
-
"Faraday::Request::UrlEncoded",
|
22
|
-
"Faraday::Adapter::NetHttp"
|
23
|
-
]
|
24
|
-
|
24
|
+
expect(instance.handler.builder.handlers.collect(&:name)).to include("ApiClient::Connection::Middlewares::Request::Logger", "Faraday::Request::UrlEncoded")
|
25
25
|
end
|
26
26
|
|
27
27
|
it "creates a Faraday object on initialize" do
|
@@ -2,26 +2,22 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe ApiClient::Connection::Oauth do
|
4
4
|
|
5
|
+
it "uses correct adapter" do
|
6
|
+
instance = ApiClient::Connection::Oauth.new("http://google.com")
|
7
|
+
expect(instance.handler.builder.adapter.name).to eq("Faraday::Adapter::NetHttp")
|
8
|
+
end
|
9
|
+
|
5
10
|
it "adds basic middlewares to faraday" do
|
6
11
|
instance = ApiClient::Connection::Oauth.new("http://google.com")
|
7
|
-
instance.handler.builder.handlers.collect(&:name)
|
8
|
-
"ApiClient::Connection::Middlewares::Request::OAuth",
|
9
|
-
"Faraday::Request::UrlEncoded",
|
10
|
-
"Faraday::Adapter::NetHttp"
|
11
|
-
]
|
12
|
+
expect(instance.handler.builder.handlers.collect(&:name))
|
13
|
+
.to include("ApiClient::Connection::Middlewares::Request::OAuth", "Faraday::Request::UrlEncoded")
|
12
14
|
end
|
13
15
|
|
14
16
|
it "adds the logger middlewares to faraday if ApiClient.logger is available" do
|
15
17
|
logger = double
|
16
18
|
ApiClient.stub(:logger).and_return(logger)
|
17
19
|
instance = ApiClient::Connection::Oauth.new("http://google.com")
|
18
|
-
instance.handler.builder.handlers.collect(&:name)
|
19
|
-
"ApiClient::Connection::Middlewares::Request::Logger",
|
20
|
-
"ApiClient::Connection::Middlewares::Request::OAuth",
|
21
|
-
"Faraday::Request::UrlEncoded",
|
22
|
-
"Faraday::Adapter::NetHttp"
|
23
|
-
]
|
24
|
-
|
20
|
+
expect(instance.handler.builder.handlers.collect(&:name))
|
21
|
+
.to include("ApiClient::Connection::Middlewares::Request::Logger", "ApiClient::Connection::Middlewares::Request::OAuth", "Faraday::Request::UrlEncoded")
|
25
22
|
end
|
26
|
-
|
27
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Zendesk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -60,7 +60,7 @@ dependencies:
|
|
60
60
|
version: 0.8.1
|
61
61
|
- - "<"
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version:
|
63
|
+
version: 2.0.0
|
64
64
|
name: faraday
|
65
65
|
prerelease: false
|
66
66
|
type: :runtime
|
@@ -71,7 +71,7 @@ dependencies:
|
|
71
71
|
version: 0.8.1
|
72
72
|
- - "<"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
74
|
+
version: 2.0.0
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
requirement: !ruby/object:Gem::Requirement
|
77
77
|
requirements:
|
@@ -154,36 +154,36 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
154
154
|
requirements:
|
155
155
|
- - ">="
|
156
156
|
- !ruby/object:Gem::Version
|
157
|
-
version: 2.
|
157
|
+
version: 2.3.8
|
158
158
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
159
|
requirements:
|
160
160
|
- - ">="
|
161
161
|
- !ruby/object:Gem::Version
|
162
162
|
version: '0'
|
163
163
|
requirements: []
|
164
|
-
rubygems_version: 3.
|
164
|
+
rubygems_version: 3.2.29
|
165
165
|
signing_key:
|
166
166
|
specification_version: 3
|
167
167
|
summary: API client builder
|
168
168
|
test_files:
|
169
169
|
- spec/spec_helper.rb
|
170
|
+
- spec/api_client/utils_spec.rb
|
170
171
|
- spec/api_client/scope_spec.rb
|
171
172
|
- spec/api_client/base_spec.rb
|
172
|
-
- spec/api_client/utils_spec.rb
|
173
|
-
- spec/api_client/connection/abstract_spec.rb
|
174
|
-
- spec/api_client/connection/basic_spec.rb
|
175
173
|
- spec/api_client/connection/oauth_spec.rb
|
176
|
-
- spec/api_client/connection/
|
177
|
-
- spec/api_client/connection/
|
174
|
+
- spec/api_client/connection/basic_spec.rb
|
175
|
+
- spec/api_client/connection/abstract_spec.rb
|
178
176
|
- spec/api_client/connection/request/oauth_spec.rb
|
179
|
-
- spec/api_client/
|
180
|
-
- spec/api_client/
|
181
|
-
- spec/api_client/
|
177
|
+
- spec/api_client/connection/request/json_spec.rb
|
178
|
+
- spec/api_client/connection/request/logger_spec.rb
|
179
|
+
- spec/api_client/resource/name_spec.rb
|
180
|
+
- spec/api_client/resource/scope_spec.rb
|
181
|
+
- spec/api_client/resource/base_spec.rb
|
182
182
|
- spec/api_client/base/delegation_spec.rb
|
183
183
|
- spec/api_client/base/connection_hook_spec.rb
|
184
184
|
- spec/api_client/base/marshalling_spec.rb
|
185
|
+
- spec/api_client/base/inheritance_spec.rb
|
186
|
+
- spec/api_client/base/instantiation_spec.rb
|
187
|
+
- spec/api_client/base/parsing_spec.rb
|
185
188
|
- spec/api_client/base/scoping_spec.rb
|
186
|
-
- spec/api_client/resource/scope_spec.rb
|
187
|
-
- spec/api_client/resource/base_spec.rb
|
188
|
-
- spec/api_client/resource/name_spec.rb
|
189
189
|
- spec/support/matchers.rb
|