gds-api-adapters 33.1.0 → 33.2.0
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/lib/gds_api/json_client.rb +1 -4
- data/lib/gds_api/version.rb +1 -1
- data/test/json_client_test.rb +10 -4
- metadata +43 -43
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3557af538323da5b11bc0f7cab83c990838837ed
|
4
|
+
data.tar.gz: ce61e653825ad488bedf28631ac9b830eaaf6c00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f579fa8cfdfdaf6d8fd0b8fb2e9c19d03baa958dbe662d2e04de15cf0469e89e08a010f70205b15219bfc84038dca5660a811ecaa620ed935043aa6a53598268
|
7
|
+
data.tar.gz: dc15adf200f8b9c77b738982fa87ed0ac6a8d0d7d5c5a97235bd35b6fcdb099b2daf92f2f27260cdb0131e84b4711ae8552f0ba6aa918ef59c81b043225db0be
|
data/lib/gds_api/json_client.rb
CHANGED
@@ -272,13 +272,10 @@ module GdsApi
|
|
272
272
|
logger.error loggable.merge(status: 'refused', error_message: e.message, error_class: e.class.name, end_time: Time.now.to_f).to_json
|
273
273
|
raise GdsApi::EndpointNotFound.new("Could not connect to #{url}")
|
274
274
|
|
275
|
-
rescue RestClient::
|
275
|
+
rescue RestClient::Exceptions::Timeout => e
|
276
276
|
logger.error loggable.merge(status: 'timeout', error_message: e.message, error_class: e.class.name, end_time: Time.now.to_f).to_json
|
277
277
|
raise GdsApi::TimedOutException.new
|
278
278
|
|
279
|
-
rescue RestClient::MaxRedirectsReached => e
|
280
|
-
raise GdsApi::TooManyRedirects
|
281
|
-
|
282
279
|
rescue RestClient::Exception => e
|
283
280
|
# Log the error here, since we have access to loggable, but raise the
|
284
281
|
# exception up to the calling method to deal with
|
data/lib/gds_api/version.rb
CHANGED
data/test/json_client_test.rb
CHANGED
@@ -477,7 +477,7 @@ class JsonClientTest < MiniTest::Spec
|
|
477
477
|
failure = lambda { |request| flunk("Request called too many times") }
|
478
478
|
stub_request(:get, url).to_return(redirect).times(11).then.to_return(failure)
|
479
479
|
|
480
|
-
assert_raises GdsApi::
|
480
|
+
assert_raises GdsApi::HTTPErrorResponse do
|
481
481
|
@client.get_json(url)
|
482
482
|
end
|
483
483
|
end
|
@@ -502,7 +502,7 @@ class JsonClientTest < MiniTest::Spec
|
|
502
502
|
stub_request(:get, first_url).to_return(first_redirect).times(6).then.to_return(failure)
|
503
503
|
stub_request(:get, second_url).to_return(second_redirect).times(6).then.to_return(failure)
|
504
504
|
|
505
|
-
assert_raises GdsApi::
|
505
|
+
assert_raises GdsApi::HTTPErrorResponse do
|
506
506
|
@client.get_json(first_url)
|
507
507
|
end
|
508
508
|
end
|
@@ -768,7 +768,10 @@ class JsonClientTest < MiniTest::Spec
|
|
768
768
|
def test_client_can_post_multipart_responses
|
769
769
|
url = "http://some.endpoint/some.json"
|
770
770
|
stub_request(:post, url).
|
771
|
-
with(:body => %r{
|
771
|
+
with(:body => %r{------RubyFormBoundary\w+\r\nContent-Disposition: form-data; name="a"\r\n\r\n123\r\n------RubyFormBoundary\w+--\r\n},
|
772
|
+
:headers => {
|
773
|
+
'Content-Type' => %r{multipart/form-data; boundary=----RubyFormBoundary\w+}
|
774
|
+
}).
|
772
775
|
to_return(:body => '{"b": "1"}', :status => 200)
|
773
776
|
|
774
777
|
response = @client.post_multipart("http://some.endpoint/some.json", {"a" => "123"})
|
@@ -797,7 +800,10 @@ class JsonClientTest < MiniTest::Spec
|
|
797
800
|
def test_client_can_put_multipart_responses
|
798
801
|
url = "http://some.endpoint/some.json"
|
799
802
|
stub_request(:put, url).
|
800
|
-
with(:body => %r{
|
803
|
+
with(:body => %r{------RubyFormBoundary\w+\r\nContent-Disposition: form-data; name="a"\r\n\r\n123\r\n------RubyFormBoundary\w+--\r\n},
|
804
|
+
:headers => {
|
805
|
+
'Content-Type' => %r{multipart/form-data; boundary=----RubyFormBoundary\w+}
|
806
|
+
}).
|
801
807
|
to_return(:body => '{"b": "1"}', :status => 200)
|
802
808
|
|
803
809
|
response = @client.put_multipart("http://some.endpoint/some.json", {"a" => "123"})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gds-api-adapters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 33.
|
4
|
+
version: 33.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Stewart
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: plek
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: '2.0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: '2.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rack-cache
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -475,56 +475,56 @@ signing_key:
|
|
475
475
|
specification_version: 4
|
476
476
|
summary: Adapters to work with GDS APIs
|
477
477
|
test_files:
|
478
|
-
- test/
|
479
|
-
- test/mapit_test.rb
|
480
|
-
- test/publishing_api_test.rb
|
481
|
-
- test/publishing_api_v2/lookup_test.rb
|
482
|
-
- test/publishing_api_v2/get_links_test.rb
|
483
|
-
- test/publishing_api_v2/get_expanded_links_test.rb
|
484
|
-
- test/whitehall_admin_api_test.rb
|
485
|
-
- test/pp_data_in_test.rb
|
486
|
-
- test/local_links_manager_api_test.rb
|
478
|
+
- test/panopticon_registerer_test.rb
|
487
479
|
- test/publishing_api/special_route_publisher_test.rb
|
488
|
-
- test/
|
489
|
-
- test/
|
490
|
-
- test/rummager_helpers_test.rb
|
480
|
+
- test/asset_manager_test.rb
|
481
|
+
- test/list_response_test.rb
|
491
482
|
- test/support_test.rb
|
492
|
-
- test/
|
483
|
+
- test/publisher_api_test.rb
|
484
|
+
- test/gov_uk_delivery_test.rb
|
485
|
+
- test/helpers_test.rb
|
486
|
+
- test/test_helper.rb
|
487
|
+
- test/panopticon_test.rb
|
488
|
+
- test/content_store_test.rb
|
489
|
+
- test/publishing_api_v2/get_links_test.rb
|
490
|
+
- test/publishing_api_v2/lookup_test.rb
|
491
|
+
- test/publishing_api_v2/get_expanded_links_test.rb
|
492
|
+
- test/external_link_tracker_test.rb
|
493
|
+
- test/imminence_api_test.rb
|
494
|
+
- test/gds_api_base_test.rb
|
495
|
+
- test/router_test.rb
|
496
|
+
- test/publishing_api_test.rb
|
497
|
+
- test/licence_application_api_test.rb
|
493
498
|
- test/test_helpers/pact_helper.rb
|
494
499
|
- test/test_helpers/panopticon_test.rb
|
500
|
+
- test/test_helpers/publishing_api_test.rb
|
495
501
|
- test/test_helpers/email_alert_api_test.rb
|
496
502
|
- test/test_helpers/publishing_api_v2_test.rb
|
497
|
-
- test/
|
498
|
-
- test/gov_uk_delivery_test.rb
|
499
|
-
- test/maslow_test.rb
|
503
|
+
- test/local_links_manager_api_test.rb
|
500
504
|
- test/govuk_headers_test.rb
|
501
|
-
- test/
|
502
|
-
- test/
|
503
|
-
- test/
|
504
|
-
- test/middleware/govuk_header_sniffer_test.rb
|
505
|
-
- test/rummager_test.rb
|
506
|
-
- test/json_client_test.rb
|
507
|
-
- test/email_alert_api_test.rb
|
508
|
-
- test/content_api_test.rb
|
509
|
-
- test/response_test.rb
|
505
|
+
- test/business_support_api_test.rb
|
506
|
+
- test/rummager_helpers_test.rb
|
507
|
+
- test/support_api_test.rb
|
510
508
|
- test/organisations_api_test.rb
|
511
|
-
- test/
|
512
|
-
- test/
|
513
|
-
- test/
|
514
|
-
- test/fixtures/
|
515
|
-
- test/fixtures/new_policies_for_dwp.json
|
516
|
-
- test/fixtures/world_organisations_australia.json
|
509
|
+
- test/maslow_test.rb
|
510
|
+
- test/json_client_test.rb
|
511
|
+
- test/need_api_test.rb
|
512
|
+
- test/fixtures/sub_sector_organisations.json
|
517
513
|
- test/fixtures/no_services_and_info_data_found_fixture.json
|
514
|
+
- test/fixtures/finder_api/cma-case-schema.json
|
515
|
+
- test/fixtures/world_organisations_australia.json
|
518
516
|
- test/fixtures/old_policies_for_dwp.json
|
519
517
|
- test/fixtures/services_and_info_fixture.json
|
520
|
-
- test/fixtures/
|
521
|
-
- test/fixtures/
|
522
|
-
- test/
|
523
|
-
- test/list_response_test.rb
|
524
|
-
- test/external_link_tracker_test.rb
|
525
|
-
- test/gds_api_base_test.rb
|
518
|
+
- test/fixtures/new_policies_for_dwp.json
|
519
|
+
- test/fixtures/hello.txt
|
520
|
+
- test/response_test.rb
|
526
521
|
- test/worldwide_api_test.rb
|
527
|
-
- test/
|
522
|
+
- test/pp_data_in_test.rb
|
523
|
+
- test/middleware/govuk_header_sniffer_test.rb
|
524
|
+
- test/content_api_test.rb
|
525
|
+
- test/email_alert_api_test.rb
|
528
526
|
- test/publishing_api_v2_test.rb
|
529
|
-
- test/
|
527
|
+
- test/rummager_test.rb
|
528
|
+
- test/mapit_test.rb
|
529
|
+
- test/whitehall_admin_api_test.rb
|
530
530
|
has_rdoc:
|