gds-api-adapters 33.1.0 → 33.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a7f9ef7bf8f91e52adc8dace6dd8a83c354241a2
4
- data.tar.gz: bef2b694c6c916177cc89c64c8c472334785fe16
3
+ metadata.gz: 3557af538323da5b11bc0f7cab83c990838837ed
4
+ data.tar.gz: ce61e653825ad488bedf28631ac9b830eaaf6c00
5
5
  SHA512:
6
- metadata.gz: 496fe45e9c5fb9c6eb2bebd9f2b74330facf5ab538ffc617a4aaef3205999671ad27722d9c55849f2f6a65cd0a0dbf9a40d9339b578dbcb9707f61782d75d272
7
- data.tar.gz: 5a6b15ea7bd76ac302ae70f47843c76b1755c831c9bd90a7d6ea99800a8ff4724de63ac37defb659ec30490363cb213f6a61e8baa71c159042dbce458dd270f1
6
+ metadata.gz: f579fa8cfdfdaf6d8fd0b8fb2e9c19d03baa958dbe662d2e04de15cf0469e89e08a010f70205b15219bfc84038dca5660a811ecaa620ed935043aa6a53598268
7
+ data.tar.gz: dc15adf200f8b9c77b738982fa87ed0ac6a8d0d7d5c5a97235bd35b6fcdb099b2daf92f2f27260cdb0131e84b4711ae8552f0ba6aa918ef59c81b043225db0be
@@ -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::RequestTimeout => e
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
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '33.1.0'
2
+ VERSION = '33.2.0'
3
3
  end
@@ -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::TooManyRedirects do
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::TooManyRedirects do
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{Content\-Disposition: form\-data; name="a"\r\n\r\n123}, :headers => {'Content-Type' => %r{multipart/form-data; boundary=\d+}}).
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{Content\-Disposition: form\-data; name="a"\r\n\r\n123}, :headers => {'Content-Type' => %r{multipart/form-data; boundary=\d+}}).
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.1.0
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-08 00:00:00.000000000 Z
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: 1.8.0
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: 1.8.0
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/support_api_test.rb
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/need_api_test.rb
489
- - test/publisher_api_test.rb
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/test_helpers/publishing_api_test.rb
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/licence_application_api_test.rb
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/helpers_test.rb
502
- - test/panopticon_registerer_test.rb
503
- - test/panopticon_test.rb
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/imminence_api_test.rb
512
- - test/content_store_test.rb
513
- - test/asset_manager_test.rb
514
- - test/fixtures/hello.txt
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/sub_sector_organisations.json
521
- - test/fixtures/finder_api/cma-case-schema.json
522
- - test/router_test.rb
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/test_helper.rb
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/business_support_api_test.rb
527
+ - test/rummager_test.rb
528
+ - test/mapit_test.rb
529
+ - test/whitehall_admin_api_test.rb
530
530
  has_rdoc: