borrow_direct 0.9.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.
Files changed (76) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +14 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +183 -0
  6. data/Rakefile +11 -0
  7. data/bd_metrics/finditem_measure.rb +61 -0
  8. data/bd_metrics/isbn.txt +1088 -0
  9. data/bd_metrics/lccn.txt +1668 -0
  10. data/bd_metrics/oclc.txt +167 -0
  11. data/borrow_direct.gemspec +30 -0
  12. data/lib/borrow_direct/authentication.rb +55 -0
  13. data/lib/borrow_direct/defaults.rb +38 -0
  14. data/lib/borrow_direct/error.rb +17 -0
  15. data/lib/borrow_direct/find_item.rb +149 -0
  16. data/lib/borrow_direct/generate_query.rb +78 -0
  17. data/lib/borrow_direct/request.rb +185 -0
  18. data/lib/borrow_direct/request_item.rb +119 -0
  19. data/lib/borrow_direct/request_query.rb +124 -0
  20. data/lib/borrow_direct/util.rb +18 -0
  21. data/lib/borrow_direct/version.rb +3 -0
  22. data/lib/borrow_direct.rb +19 -0
  23. data/test/authentication_test.rb +79 -0
  24. data/test/find_item_test.rb +159 -0
  25. data/test/generate_query_test.rb +91 -0
  26. data/test/request_item_test.rb +109 -0
  27. data/test/request_query_test.rb +113 -0
  28. data/test/request_test.rb +141 -0
  29. data/test/support/assertions.rb +23 -0
  30. data/test/support/vcr_filter.rb +45 -0
  31. data/test/test_helper.rb +39 -0
  32. data/test/util_test.rb +32 -0
  33. data/test/vcr_cassettes/Authentication/Makes_a_request_succesfully.yml +52 -0
  34. data/test/vcr_cassettes/Authentication/Raises_for_bad_library_symbol.yml +52 -0
  35. data/test/vcr_cassettes/Authentication/Raises_for_bad_patron_barcode.yml +53 -0
  36. data/test/vcr_cassettes/Authentication/get_auth_id/raises_for_a_bad_library_symbol.yml +52 -0
  37. data/test/vcr_cassettes/Authentication/get_auth_id/raises_for_a_bad_patron_barcode.yml +53 -0
  38. data/test/vcr_cassettes/Authentication/get_auth_id/returns_an_auth_id_for_a_good_request.yml +52 -0
  39. data/test/vcr_cassettes/Authentication/raw_request_to_verify_HTTP_api/.yml +52 -0
  40. data/test/vcr_cassettes/FindItem/_find_item_request/finds_a_locally_available_item.yml +49 -0
  41. data/test/vcr_cassettes/FindItem/_find_item_request/finds_a_requestable_item.yml +49 -0
  42. data/test/vcr_cassettes/FindItem/_find_item_request/finds_an_item_that_does_not_exist_in_BD.yml +50 -0
  43. data/test/vcr_cassettes/FindItem/_find_item_request/with_expected_error_PUBFI002/returns_result.yml +40 -0
  44. data/test/vcr_cassettes/FindItem/_find_item_request/works_with_multiple_values.yml +49 -0
  45. data/test/vcr_cassettes/FindItem/find_with_Response/has_an_auth_id.yml +49 -0
  46. data/test/vcr_cassettes/FindItem/find_with_Response/has_nil_auth_id_when_BD_doesn_t_want_to_give_us_one.yml +40 -0
  47. data/test/vcr_cassettes/FindItem/find_with_Response/has_nil_pickup_locations_when_BD_doesn_t_want_to_give_us_them.yml +40 -0
  48. data/test/vcr_cassettes/FindItem/find_with_Response/has_pickup_locations.yml +49 -0
  49. data/test/vcr_cassettes/FindItem/find_with_Response/not_requestable_for_item_that_BD_returns_PUBFI002.yml +40 -0
  50. data/test/vcr_cassettes/FindItem/find_with_Response/not_requestable_for_item_that_does_not_exist_in_BD.yml +50 -0
  51. data/test/vcr_cassettes/FindItem/find_with_Response/not_requestable_for_item_that_no_libraries_will_lend.yml +50 -0
  52. data/test/vcr_cassettes/FindItem/find_with_Response/not_requestable_for_locally_available_item.yml +49 -0
  53. data/test/vcr_cassettes/FindItem/find_with_Response/requestable_for_requestable_item.yml +49 -0
  54. data/test/vcr_cassettes/FindItem/find_with_Response/requestable_with_multiple_items_if_at_least_one_is_requestable.yml +49 -0
  55. data/test/vcr_cassettes/Request/authentication_id/automatically_fetches_one_when_needed.yml +52 -0
  56. data/test/vcr_cassettes/Request/authentication_id/can_refetch_when_instructed.yml +52 -0
  57. data/test/vcr_cassettes/Request/can_make_a_succesful_request.yml +49 -0
  58. data/test/vcr_cassettes/Request/gets_BD_error_info.yml +41 -0
  59. data/test/vcr_cassettes/Request/raises_on_bad_path.yml +53 -0
  60. data/test/vcr_cassettes/Request/raises_on_bad_request_hash.yml +63 -0
  61. data/test/vcr_cassettes/Request/with_expected_errors/still_returns_result.yml +41 -0
  62. data/test/vcr_cassettes/RequestItem/make_request/make_request_for_a_locally_available_item.yml +90 -0
  63. data/test/vcr_cassettes/RequestItem/make_request/make_request_for_a_requestable_item.yml +89 -0
  64. data/test/vcr_cassettes/RequestItem/make_request/make_request_for_an_unrequestable_item.yml +91 -0
  65. data/test/vcr_cassettes/RequestItem/make_request/raises_for_unrequestable.yml +91 -0
  66. data/test/vcr_cassettes/RequestItem/make_request/returns_number_for_succesful_request.yml +89 -0
  67. data/test/vcr_cassettes/RequestItem/make_request/says_no_for_item_that_BD_returns_PUBRI004.yml +89 -0
  68. data/test/vcr_cassettes/RequestItem/raw_requests_an_unrequestable_item.yml +91 -0
  69. data/test/vcr_cassettes/RequestItem/uses_manually_set_auth_id.yml +89 -0
  70. data/test/vcr_cassettes/RequestItem/with_pickup_location_and_requestable_item/still_works.yml +90 -0
  71. data/test/vcr_cassettes/RequestQuery/raw_request_query_request/returns_results.yml +381 -0
  72. data/test/vcr_cassettes/RequestQuery/raw_request_to_verify_the_BD_HTTP_API.yml +381 -0
  73. data/test/vcr_cassettes/RequestQuery/requests/fetches_default_records.yml +384 -0
  74. data/test/vcr_cassettes/RequestQuery/requests/fetches_full_records.yml +481 -0
  75. data/test/vcr_cassettes/top_level_describe/an_inner_describe/.yml +76 -0
  76. metadata +262 -0
@@ -0,0 +1,39 @@
1
+ require 'minitest'
2
+ require 'minitest/autorun'
3
+ require "minispec-metadata"
4
+
5
+
6
+ require 'vcr'
7
+ require 'webmock'
8
+ require 'minitest-vcr'
9
+
10
+ require 'borrow_direct'
11
+
12
+
13
+ # Load support files
14
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
15
+
16
+ VCR.configure do |c|
17
+ c.cassette_library_dir = 'test/vcr_cassettes'
18
+ c.hook_into :webmock # or :fakeweb
19
+
20
+ # BD API requests tend to have their distinguishing
21
+ # features in a POSTed JSON request body
22
+ c.default_cassette_options = { :match_requests_on => [:method, :uri, :body] }
23
+ end
24
+
25
+ MinitestVcr::Spec.configure!
26
+
27
+ VCRFilter.sensitive_data! :bd_library_symbol
28
+ VCRFilter.sensitive_data! :bd_patron
29
+
30
+ # Silly way to not have to rewrite all our tests if we
31
+ # temporarily disable VCR, make VCR.use_cassette a no-op
32
+ # instead of no-such-method.
33
+ if ! defined? VCR
34
+ module VCR
35
+ def self.use_cassette(*args)
36
+ yield
37
+ end
38
+ end
39
+ end
data/test/util_test.rb ADDED
@@ -0,0 +1,32 @@
1
+ require 'test_helper'
2
+
3
+ describe "BorrowDirect Util" do
4
+
5
+ describe "#hash_key_path" do
6
+ it "looks up one level" do
7
+ hash = {:foo => 1}
8
+
9
+ assert_equal 1, BorrowDirect::Util.hash_key_path(hash, :foo)
10
+ assert_nil BorrowDirect::Util.hash_key_path(hash, :bar)
11
+ end
12
+
13
+ it "looks up multi-level" do
14
+ hash = {
15
+ :one => {
16
+ :two => {
17
+ :three => "value"
18
+ }
19
+ }
20
+ }
21
+
22
+ assert_equal "value", BorrowDirect::Util.hash_key_path(hash, :one, :two, :three)
23
+ assert_nil BorrowDirect::Util.hash_key_path(hash, :notfound)
24
+ assert_nil BorrowDirect::Util.hash_key_path(hash, :one, :two, :notfound)
25
+ assert_nil BorrowDirect::Util.hash_key_path(hash, :one, :notfound, :notfound)
26
+ assert_nil BorrowDirect::Util.hash_key_path(hash, :notfound, :two, :notfound)
27
+ assert_nil BorrowDirect::Util.hash_key_path(hash, :notfound, :two, :notfound, :notfound)
28
+ end
29
+
30
+ end
31
+
32
+ end
@@ -0,0 +1,52 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://bdtest.relais-host.com/portal-service/user/authentication/patron
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"AuthenticationInformation":{"LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","PatronId":"DUMMY_BD_PATRON"}}'
9
+ headers:
10
+ User-Agent:
11
+ - ruby borrow_direct gem 0.0.1 (HTTPClient 2.5.1) https://github.com/jrochkind/borrow_direct
12
+ Accept:
13
+ - ! '*/*'
14
+ Date:
15
+ - Tue, 21 Oct 2014 17:12:18 GMT
16
+ Content-Type:
17
+ - application/json
18
+ Accept-Language:
19
+ - en
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - nginx/1.4.1
27
+ Date:
28
+ - Tue, 21 Oct 2014 17:12:19 GMT
29
+ Content-Type:
30
+ - application/json;charset=UTF-8
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - keep-alive
35
+ Set-Cookie:
36
+ - visited=yes
37
+ Expires:
38
+ - Thu, 01 Jan 1970 00:00:00 GMT
39
+ - Thu, 01 Jan 1970 00:00:00 GMT
40
+ Content-Language:
41
+ - en
42
+ Pragma:
43
+ - no-cache
44
+ Cache-Control:
45
+ - no-cache, no-store, max-age=0
46
+ body:
47
+ encoding: US-ASCII
48
+ string: ! '{"Authentication":{"AuthnUserInfo":{"AId":"tFF-BdWcr1Kmkax3xz1mQBG5SEY","LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","Iso639_2_LangCode":"ENG","UserLogin":"DUMMY_BD_PATRON","FirstName":"Jonathan","LastName":"Rochkind","AllowLoanAddRequest":true,"AllowCopyAddRequest":false,"AllowSelDelivLoanChange":true,"AllowSelDelivCopyChange":false,"ILSProfile":{"EmailAddress":"jonathan@dnil.net","Telephone":"4105168886","AddressInformation":{"Address1":"Library
49
+ Systems","Address2":"MSE Library\r\nHomewood Campus"}}}}}'
50
+ http_version:
51
+ recorded_at: Tue, 21 Oct 2014 17:12:19 GMT
52
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,52 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://bdtest.relais-host.com/portal-service/user/authentication/patron
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"AuthenticationInformation":{"LibrarySymbol":"BAD_SYMBOL","PatronId":"DUMMY_BD_PATRON"}}'
9
+ headers:
10
+ User-Agent:
11
+ - ruby borrow_direct gem 0.0.1 (HTTPClient 2.5.1) https://github.com/jrochkind/borrow_direct
12
+ Accept:
13
+ - ! '*/*'
14
+ Date:
15
+ - Tue, 21 Oct 2014 17:12:17 GMT
16
+ Content-Type:
17
+ - application/json
18
+ Accept-Language:
19
+ - en
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - nginx/1.4.1
27
+ Date:
28
+ - Tue, 21 Oct 2014 17:12:18 GMT
29
+ Content-Type:
30
+ - application/json;charset=UTF-8
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - keep-alive
35
+ Set-Cookie:
36
+ - visited=yes
37
+ Expires:
38
+ - Thu, 01 Jan 1970 00:00:00 GMT
39
+ - Thu, 01 Jan 1970 00:00:00 GMT
40
+ Content-Language:
41
+ - en
42
+ Pragma:
43
+ - no-cache
44
+ Cache-Control:
45
+ - no-cache, no-store, max-age=0
46
+ body:
47
+ encoding: US-ASCII
48
+ string: ! '{"Authentication":{"Problem":{"Code":"PUBAN005","Message":"Invalid
49
+ library symbol"}}}'
50
+ http_version:
51
+ recorded_at: Tue, 21 Oct 2014 17:12:18 GMT
52
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,53 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://bdtest.relais-host.com/portal-service/user/authentication/patron
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"AuthenticationInformation":{"LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","PatronId":"BAD_BARCODE"}}'
9
+ headers:
10
+ User-Agent:
11
+ - ruby borrow_direct gem 0.0.1 (HTTPClient 2.5.1) https://github.com/jrochkind/borrow_direct
12
+ Accept:
13
+ - ! '*/*'
14
+ Date:
15
+ - Tue, 21 Oct 2014 17:12:16 GMT
16
+ Content-Type:
17
+ - application/json
18
+ Accept-Language:
19
+ - en
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - nginx/1.4.1
27
+ Date:
28
+ - Tue, 21 Oct 2014 17:12:17 GMT
29
+ Content-Type:
30
+ - application/json;charset=UTF-8
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - keep-alive
35
+ Set-Cookie:
36
+ - visited=yes
37
+ Expires:
38
+ - Thu, 01 Jan 1970 00:00:00 GMT
39
+ - Thu, 01 Jan 1970 00:00:00 GMT
40
+ Content-Language:
41
+ - en
42
+ Pragma:
43
+ - no-cache
44
+ Cache-Control:
45
+ - no-cache, no-store, max-age=0
46
+ body:
47
+ encoding: US-ASCII
48
+ string: ! '{"Authentication":{"Problem":{"Code":"PUBAN003","Message":"Authentication
49
+ failed[NCIP_MSG:Unknown User - #Unknown borrower barcode - please refer to
50
+ the circulation desk.]"}}}'
51
+ http_version:
52
+ recorded_at: Tue, 21 Oct 2014 17:12:17 GMT
53
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,52 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://bdtest.relais-host.com/portal-service/user/authentication/patron
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"AuthenticationInformation":{"LibrarySymbol":"BAD_SYMBOL","PatronId":"DUMMY_BD_PATRON"}}'
9
+ headers:
10
+ User-Agent:
11
+ - ruby borrow_direct gem 0.0.1 (HTTPClient 2.5.1) https://github.com/jrochkind/borrow_direct
12
+ Accept:
13
+ - ! '*/*'
14
+ Date:
15
+ - Tue, 21 Oct 2014 17:12:20 GMT
16
+ Content-Type:
17
+ - application/json
18
+ Accept-Language:
19
+ - en
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - nginx/1.4.1
27
+ Date:
28
+ - Tue, 21 Oct 2014 17:12:21 GMT
29
+ Content-Type:
30
+ - application/json;charset=UTF-8
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - keep-alive
35
+ Set-Cookie:
36
+ - visited=yes
37
+ Expires:
38
+ - Thu, 01 Jan 1970 00:00:00 GMT
39
+ - Thu, 01 Jan 1970 00:00:00 GMT
40
+ Content-Language:
41
+ - en
42
+ Pragma:
43
+ - no-cache
44
+ Cache-Control:
45
+ - no-cache, no-store, max-age=0
46
+ body:
47
+ encoding: US-ASCII
48
+ string: ! '{"Authentication":{"Problem":{"Code":"PUBAN005","Message":"Invalid
49
+ library symbol"}}}'
50
+ http_version:
51
+ recorded_at: Tue, 21 Oct 2014 17:12:21 GMT
52
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,53 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://bdtest.relais-host.com/portal-service/user/authentication/patron
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"AuthenticationInformation":{"LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","PatronId":"BAD_BARCODE"}}'
9
+ headers:
10
+ User-Agent:
11
+ - ruby borrow_direct gem 0.0.1 (HTTPClient 2.5.1) https://github.com/jrochkind/borrow_direct
12
+ Accept:
13
+ - ! '*/*'
14
+ Date:
15
+ - Tue, 21 Oct 2014 17:12:21 GMT
16
+ Content-Type:
17
+ - application/json
18
+ Accept-Language:
19
+ - en
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - nginx/1.4.1
27
+ Date:
28
+ - Tue, 21 Oct 2014 17:12:22 GMT
29
+ Content-Type:
30
+ - application/json;charset=UTF-8
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - keep-alive
35
+ Set-Cookie:
36
+ - visited=yes
37
+ Expires:
38
+ - Thu, 01 Jan 1970 00:00:00 GMT
39
+ - Thu, 01 Jan 1970 00:00:00 GMT
40
+ Content-Language:
41
+ - en
42
+ Pragma:
43
+ - no-cache
44
+ Cache-Control:
45
+ - no-cache, no-store, max-age=0
46
+ body:
47
+ encoding: US-ASCII
48
+ string: ! '{"Authentication":{"Problem":{"Code":"PUBAN003","Message":"Authentication
49
+ failed[NCIP_MSG:Unknown User - #Unknown borrower barcode - please refer to
50
+ the circulation desk.]"}}}'
51
+ http_version:
52
+ recorded_at: Tue, 21 Oct 2014 17:12:22 GMT
53
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,52 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://bdtest.relais-host.com/portal-service/user/authentication/patron
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"AuthenticationInformation":{"LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","PatronId":"DUMMY_BD_PATRON"}}'
9
+ headers:
10
+ User-Agent:
11
+ - ruby borrow_direct gem 0.0.1 (HTTPClient 2.5.1) https://github.com/jrochkind/borrow_direct
12
+ Accept:
13
+ - ! '*/*'
14
+ Date:
15
+ - Tue, 21 Oct 2014 17:12:19 GMT
16
+ Content-Type:
17
+ - application/json
18
+ Accept-Language:
19
+ - en
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - nginx/1.4.1
27
+ Date:
28
+ - Tue, 21 Oct 2014 17:12:20 GMT
29
+ Content-Type:
30
+ - application/json;charset=UTF-8
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - keep-alive
35
+ Set-Cookie:
36
+ - visited=yes
37
+ Expires:
38
+ - Thu, 01 Jan 1970 00:00:00 GMT
39
+ - Thu, 01 Jan 1970 00:00:00 GMT
40
+ Content-Language:
41
+ - en
42
+ Pragma:
43
+ - no-cache
44
+ Cache-Control:
45
+ - no-cache, no-store, max-age=0
46
+ body:
47
+ encoding: US-ASCII
48
+ string: ! '{"Authentication":{"AuthnUserInfo":{"AId":"y7--en9-2ARz3LwtEGg6_sBKRY0","LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","Iso639_2_LangCode":"ENG","UserLogin":"DUMMY_BD_PATRON","FirstName":"Jonathan","LastName":"Rochkind","AllowLoanAddRequest":true,"AllowCopyAddRequest":false,"AllowSelDelivLoanChange":true,"AllowSelDelivCopyChange":false,"ILSProfile":{"EmailAddress":"jonathan@dnil.net","Telephone":"4105168886","AddressInformation":{"Address1":"Library
49
+ Systems","Address2":"MSE Library\r\nHomewood Campus"}}}}}'
50
+ http_version:
51
+ recorded_at: Tue, 21 Oct 2014 17:12:20 GMT
52
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,52 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://bdtest.relais-host.com/portal-service/user/authentication/patron
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"AuthenticationInformation":{"LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","PatronId":"DUMMY_BD_PATRON"}}'
9
+ headers:
10
+ User-Agent:
11
+ - ruby borrow_direct gem (0.0.1) https://github.com/jrochkind/borrow_direct
12
+ Accept:
13
+ - ! '*/*'
14
+ Date:
15
+ - Tue, 21 Oct 2014 17:12:22 GMT
16
+ Content-Type:
17
+ - application/json
18
+ Accept-Language:
19
+ - en
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - nginx/1.4.1
27
+ Date:
28
+ - Tue, 21 Oct 2014 17:12:23 GMT
29
+ Content-Type:
30
+ - application/json;charset=UTF-8
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - keep-alive
35
+ Set-Cookie:
36
+ - visited=yes
37
+ Expires:
38
+ - Thu, 01 Jan 1970 00:00:00 GMT
39
+ - Thu, 01 Jan 1970 00:00:00 GMT
40
+ Content-Language:
41
+ - en
42
+ Pragma:
43
+ - no-cache
44
+ Cache-Control:
45
+ - no-cache, no-store, max-age=0
46
+ body:
47
+ encoding: US-ASCII
48
+ string: ! '{"Authentication":{"AuthnUserInfo":{"AId":"CSN-4e1Y046kC14NZxZBbUYLP40","LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","Iso639_2_LangCode":"ENG","UserLogin":"DUMMY_BD_PATRON","FirstName":"Jonathan","LastName":"Rochkind","AllowLoanAddRequest":true,"AllowCopyAddRequest":false,"AllowSelDelivLoanChange":true,"AllowSelDelivCopyChange":false,"ILSProfile":{"EmailAddress":"jonathan@dnil.net","Telephone":"4105168886","AddressInformation":{"Address1":"Library
49
+ Systems","Address2":"MSE Library\r\nHomewood Campus"}}}}}'
50
+ http_version:
51
+ recorded_at: Tue, 21 Oct 2014 17:12:24 GMT
52
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,49 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://bdtest.relais-host.com/dws/item/available
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"PartnershipId":"BD","Credentials":{"LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","Barcode":"DUMMY_BD_PATRON"},"ExactSearch":[{"Type":"ISBN","Value":"0745649890"}]}'
9
+ headers:
10
+ User-Agent:
11
+ - ruby borrow_direct gem 0.0.1 (HTTPClient 2.5.1) https://github.com/jrochkind/borrow_direct
12
+ Accept:
13
+ - ! '*/*'
14
+ Date:
15
+ - Tue, 21 Oct 2014 17:06:18 GMT
16
+ Content-Type:
17
+ - application/json
18
+ Accept-Language:
19
+ - en
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - nginx/1.4.1
27
+ Date:
28
+ - Tue, 21 Oct 2014 17:06:20 GMT
29
+ Content-Type:
30
+ - application/json;charset=UTF-8
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - keep-alive
35
+ body:
36
+ encoding: US-ASCII
37
+ string: ! '{"Item":{"Available":true,"SearchTerm":"isbn=0745649890","AuthorizationId":"24ElL0dfW41gCqBUbIt9sE8iCTI","RequestLink":{"RequestMessage":"This
38
+ item is available locally"},"PickupLocations":{"PickupLocation":["*Milton
39
+ S. Eisenhower Library","APL - EP STUDENTS - Ed Center","APL STAFF - Room 5-17","Arthur
40
+ Friedheim Library","Columbia Center","Harbor East","Harrison Medical Library-Bayview","Institute
41
+ of the History of Medicine","JH Medical Campus Office (faculty and staff)","JHMI
42
+ Pickup - Armstrong 306","JHMI Pickup - BSPH E4643","JHMI Pickup - Hampton
43
+ House 9th floor","JHMI Pickup - PCTB 115-116","JHMI Pickup - School of Nursing
44
+ 313","JHU Homewood Office (faculty and grad students)","Montgomery Library
45
+ Resource Center","SAIS Library","Washington Library Resource Center","Welch
46
+ Medical Library","Wilmer Friedenwald Library"]}}}'
47
+ http_version:
48
+ recorded_at: Tue, 21 Oct 2014 17:06:20 GMT
49
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,49 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://bdtest.relais-host.com/dws/item/available
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"PartnershipId":"BD","Credentials":{"LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","Barcode":"DUMMY_BD_PATRON"},"ExactSearch":[{"Type":"ISBN","Value":"9810743734"}]}'
9
+ headers:
10
+ User-Agent:
11
+ - ruby borrow_direct gem 0.0.1 (HTTPClient 2.5.1) https://github.com/jrochkind/borrow_direct
12
+ Accept:
13
+ - ! '*/*'
14
+ Date:
15
+ - Tue, 21 Oct 2014 17:06:01 GMT
16
+ Content-Type:
17
+ - application/json
18
+ Accept-Language:
19
+ - en
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - nginx/1.4.1
27
+ Date:
28
+ - Tue, 21 Oct 2014 17:06:04 GMT
29
+ Content-Type:
30
+ - application/json;charset=UTF-8
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - keep-alive
35
+ body:
36
+ encoding: US-ASCII
37
+ string: ! '{"Item":{"Available":true,"SearchTerm":"isbn=9810743734","AuthorizationId":"DqYxVE0T5hes99hv3nNswZK3zqg","RequestLink":{"ButtonLink":"AddRequest","ButtonLabel":"Request","RequestMessage":"Request
38
+ this item"},"PickupLocations":{"PickupLocation":["*Milton S. Eisenhower Library","APL
39
+ - EP STUDENTS - Ed Center","APL STAFF - Room 5-17","Arthur Friedheim Library","Columbia
40
+ Center","Harbor East","Harrison Medical Library-Bayview","Institute of the
41
+ History of Medicine","JH Medical Campus Office (faculty and staff)","JHMI
42
+ Pickup - Armstrong 306","JHMI Pickup - BSPH E4643","JHMI Pickup - Hampton
43
+ House 9th floor","JHMI Pickup - PCTB 115-116","JHMI Pickup - School of Nursing
44
+ 313","JHU Homewood Office (faculty and grad students)","Montgomery Library
45
+ Resource Center","SAIS Library","Washington Library Resource Center","Welch
46
+ Medical Library","Wilmer Friedenwald Library"]}}}'
47
+ http_version:
48
+ recorded_at: Tue, 21 Oct 2014 17:06:04 GMT
49
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://bdtest.relais-host.com/dws/item/available
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"PartnershipId":"BD","Credentials":{"LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","Barcode":"DUMMY_BD_PATRON"},"ExactSearch":[{"Type":"ISBN","Value":"NO_SUCH_THING"}]}'
9
+ headers:
10
+ User-Agent:
11
+ - ruby borrow_direct gem 0.0.1 (HTTPClient 2.5.1) https://github.com/jrochkind/borrow_direct
12
+ Accept:
13
+ - ! '*/*'
14
+ Date:
15
+ - Tue, 21 Oct 2014 17:06:04 GMT
16
+ Content-Type:
17
+ - application/json
18
+ Accept-Language:
19
+ - en
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - nginx/1.4.1
27
+ Date:
28
+ - Tue, 21 Oct 2014 17:06:16 GMT
29
+ Content-Type:
30
+ - application/json;charset=UTF-8
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - keep-alive
35
+ body:
36
+ encoding: US-ASCII
37
+ string: ! '{"Item":{"Available":false,"SearchTerm":"isbn=NO_SUCH_THING","AuthorizationId":"yhIaAAsllFzfvgmqRPbFU2AbiPI","RequestLink":{"ButtonLink":"http://findit.library.jhu.edu/resolve?genre=book","ButtonLabel":"Request","RequestMessage":"Borrow
38
+ Direct cannot fill this request at this time. Please request through Interlibrary
39
+ Loan."},"PickupLocations":{"PickupLocation":["*Milton S. Eisenhower Library","APL
40
+ - EP STUDENTS - Ed Center","APL STAFF - Room 5-17","Arthur Friedheim Library","Columbia
41
+ Center","Harbor East","Harrison Medical Library-Bayview","Institute of the
42
+ History of Medicine","JH Medical Campus Office (faculty and staff)","JHMI
43
+ Pickup - Armstrong 306","JHMI Pickup - BSPH E4643","JHMI Pickup - Hampton
44
+ House 9th floor","JHMI Pickup - PCTB 115-116","JHMI Pickup - School of Nursing
45
+ 313","JHU Homewood Office (faculty and grad students)","Montgomery Library
46
+ Resource Center","SAIS Library","Washington Library Resource Center","Welch
47
+ Medical Library","Wilmer Friedenwald Library"]}}}'
48
+ http_version:
49
+ recorded_at: Tue, 21 Oct 2014 17:06:16 GMT
50
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://bdtest.relais-host.com/dws/item/available
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"PartnershipId":"BD","Credentials":{"LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","Barcode":"DUMMY_BD_PATRON"},"ExactSearch":[{"Type":"ISBN","Value":"0109836413"}]}'
9
+ headers:
10
+ User-Agent:
11
+ - ruby borrow_direct gem 0.0.1 (HTTPClient 2.5.1) https://github.com/jrochkind/borrow_direct
12
+ Accept:
13
+ - ! '*/*'
14
+ Date:
15
+ - Tue, 21 Oct 2014 17:05:45 GMT
16
+ Content-Type:
17
+ - application/json
18
+ Accept-Language:
19
+ - en
20
+ response:
21
+ status:
22
+ code: 404
23
+ message: Not Found
24
+ headers:
25
+ Server:
26
+ - nginx/1.4.1
27
+ Date:
28
+ - Tue, 21 Oct 2014 17:05:46 GMT
29
+ Content-Type:
30
+ - application/json;charset=UTF-8
31
+ Transfer-Encoding:
32
+ - chunked
33
+ Connection:
34
+ - keep-alive
35
+ body:
36
+ encoding: US-ASCII
37
+ string: ! '{"Error":{"ErrorNumber":"PUBFI002","ErrorMessage":"No result"}}'
38
+ http_version:
39
+ recorded_at: Tue, 21 Oct 2014 17:05:47 GMT
40
+ recorded_with: VCR 2.9.3