borrow_direct 1.1.0 → 1.2.0.pre1

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 (91) hide show
  1. checksums.yaml +5 -13
  2. data/.travis.yml +6 -0
  3. data/Gemfile +2 -0
  4. data/README.md +19 -6
  5. data/bd_metrics/finditem_measure.rb +8 -1
  6. data/borrow_direct.gemspec +1 -1
  7. data/lib/borrow_direct/authentication.rb +16 -8
  8. data/lib/borrow_direct/defaults.rb +4 -1
  9. data/lib/borrow_direct/encryption.rb +34 -0
  10. data/lib/borrow_direct/error.rb +17 -0
  11. data/lib/borrow_direct/find_item.rb +32 -18
  12. data/lib/borrow_direct/pickup_location.rb +32 -0
  13. data/lib/borrow_direct/request.rb +30 -8
  14. data/lib/borrow_direct/request_item.rb +15 -7
  15. data/lib/borrow_direct/request_query.rb +18 -4
  16. data/lib/borrow_direct/version.rb +1 -1
  17. data/test/authentication_test.rb +40 -12
  18. data/test/encryption_test.rb +58 -0
  19. data/test/find_item_test.rb +66 -11
  20. data/test/request_item_test.rb +65 -8
  21. data/test/request_query_test.rb +23 -27
  22. data/test/request_test.rb +40 -27
  23. data/test/test_helper.rb +10 -1
  24. data/test/vcr_cassettes/Authentication/Makes_a_request_succesfully.yml +11 -23
  25. data/test/vcr_cassettes/Authentication/Raises_for_bad_library_symbol.yml +12 -23
  26. data/test/vcr_cassettes/Authentication/Raises_for_bad_patron_barcode.yml +12 -24
  27. data/test/vcr_cassettes/Authentication/get_auth_id/Raises_for_bad_api_key.yml +41 -0
  28. data/test/vcr_cassettes/Authentication/get_auth_id/raises_for_a_bad_library_symbol.yml +12 -23
  29. data/test/vcr_cassettes/Authentication/get_auth_id/raises_for_a_bad_patron_barcode.yml +12 -24
  30. data/test/vcr_cassettes/Authentication/get_auth_id/returns_an_auth_id_for_a_good_request.yml +11 -23
  31. data/test/vcr_cassettes/Authentication/get_auth_id/returns_auth_id_with_API_key_from_defaults.yml +40 -0
  32. data/test/vcr_cassettes/Authentication/raw_request_to_verify_HTTP_api/works.yml +11 -23
  33. data/test/vcr_cassettes/FindItem/_find_item_request/Raises_with_bad_api_key.yml +41 -0
  34. data/test/vcr_cassettes/FindItem/_find_item_request/finds_a_locally_available_item.yml +47 -18
  35. data/test/vcr_cassettes/FindItem/_find_item_request/finds_a_requestable_item.yml +66 -18
  36. data/test/vcr_cassettes/FindItem/_find_item_request/finds_an_item_that_does_not_exist_in_BD.yml +66 -19
  37. data/test/vcr_cassettes/FindItem/_find_item_request/raises_proper_error_on_bad_AID.yml +40 -0
  38. data/test/vcr_cassettes/FindItem/_find_item_request/uses_manually_set_auth_id.yml +97 -0
  39. data/test/vcr_cassettes/FindItem/_find_item_request/with_expected_error_PUBFI002/returns_result.yml +46 -9
  40. data/test/vcr_cassettes/FindItem/_find_item_request/works_with_multiple_values.yml +66 -18
  41. data/test/vcr_cassettes/FindItem/find_with_Response/_pickup_location_data/returns_array_of_PickupLocations.yml +97 -0
  42. data/test/vcr_cassettes/FindItem/find_with_Response/has_an_auth_id.yml +66 -18
  43. data/test/vcr_cassettes/FindItem/find_with_Response/has_nil_pickup_locations_when_BD_doesn_t_want_to_give_us_them.yml +46 -9
  44. data/test/vcr_cassettes/FindItem/find_with_Response/has_pickup_locations.yml +66 -18
  45. data/test/vcr_cassettes/FindItem/find_with_Response/knows_locally_available_.yml +47 -18
  46. data/test/vcr_cassettes/FindItem/find_with_Response/not_requestable_for_item_that_BD_returns_PUBFI002.yml +46 -9
  47. data/test/vcr_cassettes/FindItem/find_with_Response/not_requestable_for_item_that_does_not_exist_in_BD.yml +46 -19
  48. data/test/vcr_cassettes/FindItem/find_with_Response/not_requestable_for_item_that_no_libraries_will_lend.yml +275 -18
  49. data/test/vcr_cassettes/FindItem/find_with_Response/not_requestable_for_locally_available_item.yml +47 -18
  50. data/test/vcr_cassettes/FindItem/find_with_Response/requestable_for_requestable_item.yml +66 -18
  51. data/test/vcr_cassettes/FindItem/find_with_Response/requestable_with_multiple_items_if_at_least_one_is_requestable.yml +66 -18
  52. data/test/vcr_cassettes/Request/authentication_id/automatically_fetches_one_when_needed.yml +47 -22
  53. data/test/vcr_cassettes/Request/authentication_id/can_refetch_when_instructed.yml +47 -22
  54. data/test/vcr_cassettes/Request/authentication_id/manually_set_one_will_be_used_without_fetch.yml +40 -0
  55. data/test/vcr_cassettes/Request/authentication_id/starts_out_nil.yml +40 -0
  56. data/test/vcr_cassettes/Request/authentication_id/takes_with_auth_id.yml +40 -0
  57. data/test/vcr_cassettes/Request/can_make_a_succesful_request_with_AID.yml +97 -0
  58. data/test/vcr_cassettes/Request/gets_BD_error_info.yml +49 -12
  59. data/test/vcr_cassettes/Request/gets_BD_error_info_from_a_bad_AID.yml +77 -0
  60. data/test/vcr_cassettes/Request/raises_exception_on_timeout_live.yml +40 -0
  61. data/test/vcr_cassettes/Request/raises_on_bad_path.yml +61 -24
  62. data/test/vcr_cassettes/Request/raises_on_bad_request_hash.yml +50 -35
  63. data/test/vcr_cassettes/Request/uses_timeout_for_HttpClient.yml +40 -0
  64. data/test/vcr_cassettes/Request/with_expected_errors/still_returns_result.yml +47 -10
  65. data/test/vcr_cassettes/RequestItem/make_request/make_request_for_a_locally_available_item.yml +21 -33
  66. data/test/vcr_cassettes/RequestItem/make_request/make_request_for_a_requestable_item.yml +20 -32
  67. data/test/vcr_cassettes/RequestItem/make_request/make_request_for_an_unrequestable_item.yml +21 -33
  68. data/test/vcr_cassettes/RequestItem/make_request/says_no_for_item_that_BD_returns_PUBRI003.yml +77 -0
  69. data/test/vcr_cassettes/RequestItem/make_request/sets_an_auth_id.yml +77 -0
  70. data/test/vcr_cassettes/RequestItem/make_request_/raises_for_unrequestable.yml +21 -33
  71. data/test/vcr_cassettes/RequestItem/make_request_/returns_number_for_succesful_request.yml +20 -32
  72. data/test/vcr_cassettes/RequestItem/raises_proper_error_on_bad_AID.yml +40 -0
  73. data/test/vcr_cassettes/RequestItem/raw_RequestItem_sanity_check.yml +134 -0
  74. data/test/vcr_cassettes/RequestItem/raw_requests_an_unrequestable_item.yml +21 -33
  75. data/test/vcr_cassettes/RequestItem/uses_manually_set_auth_id.yml +20 -32
  76. data/test/vcr_cassettes/RequestItem/with_pickup_location_and_requestable_item/works_with_String_pickup_location.yml +78 -0
  77. data/test/vcr_cassettes/RequestItem/with_pickup_location_and_requestable_item/works_with_structured_PickupLocation.yml +77 -0
  78. data/test/vcr_cassettes/RequestQuery/raises_proper_error_on_bad_AID.yml +40 -0
  79. data/test/vcr_cassettes/RequestQuery/raw_request_query_request/returns_results.yml +117 -325
  80. data/test/vcr_cassettes/RequestQuery/raw_request_to_verify_the_BD_HTTP_API.yml +30 -325
  81. data/test/vcr_cassettes/RequestQuery/requests/fetches_default_records.yml +117 -328
  82. data/test/vcr_cassettes/RequestQuery/requests/fetches_full_records.yml +148 -425
  83. metadata +67 -38
  84. data/test/vcr_cassettes/Authentication/raw_request_to_verify_HTTP_api/.yml +0 -52
  85. data/test/vcr_cassettes/FindItem/find_with_Response/has_nil_auth_id_when_BD_doesn_t_want_to_give_us_one.yml +0 -40
  86. data/test/vcr_cassettes/Request/can_make_a_succesful_request.yml +0 -49
  87. data/test/vcr_cassettes/RequestItem/make_request/raises_for_unrequestable.yml +0 -91
  88. data/test/vcr_cassettes/RequestItem/make_request/returns_number_for_succesful_request.yml +0 -89
  89. data/test/vcr_cassettes/RequestItem/make_request/says_no_for_item_that_BD_returns_PUBRI004.yml +0 -89
  90. data/test/vcr_cassettes/RequestItem/with_pickup_location_and_requestable_item/still_works.yml +0 -90
  91. data/test/vcr_cassettes/top_level_describe/an_inner_describe/.yml +0 -76
@@ -2,17 +2,17 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://bdtest.relais-host.com/dws/item/available
5
+ uri: https://rc.relais-host.com/portal-service/user/authentication
6
6
  body:
7
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"}]}'
8
+ string: '{"ApiKey":"DUMMY_BD_API_KEY","PartnershipId":"BD","UserGroup":"patron","LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","PatronId":"DUMMY_BD_PATRON"}'
9
9
  headers:
10
10
  User-Agent:
11
- - ruby borrow_direct gem 0.0.1 (HTTPClient 2.5.1) https://github.com/jrochkind/borrow_direct
11
+ - ruby borrow_direct gem 1.2.0 (HTTPClient 2.6.0.1) https://github.com/jrochkind/borrow_direct
12
12
  Accept:
13
- - ! '*/*'
13
+ - "*/*"
14
14
  Date:
15
- - Tue, 21 Oct 2014 17:06:46 GMT
15
+ - Thu, 15 Oct 2015 15:14:44 GMT
16
16
  Content-Type:
17
17
  - application/json
18
18
  Accept-Language:
@@ -25,7 +25,44 @@ http_interactions:
25
25
  Server:
26
26
  - nginx/1.4.1
27
27
  Date:
28
- - Tue, 21 Oct 2014 17:06:58 GMT
28
+ - Thu, 15 Oct 2015 15:14:45 GMT
29
+ Content-Type:
30
+ - application/json;charset=UTF-8
31
+ Content-Length:
32
+ - '269'
33
+ Connection:
34
+ - keep-alive
35
+ body:
36
+ encoding: UTF-8
37
+ string: '{"AuthorizationId":"7x-ZtsJBsU3Gz1WpdDNtXKjVACw","LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","Iso639_2_LangCode":"ENG","FirstName":"Jonathan","LastName":"Rochkind","AllowLoanAddRequest":true,"AllowCopyAddRequest":false,"AllowSelDelivLoanChange":true,"AllowSelDelivCopyChange":false}'
38
+ http_version:
39
+ recorded_at: Thu, 15 Oct 2015 15:14:45 GMT
40
+ - request:
41
+ method: post
42
+ uri: https://rc.relais-host.com/dws/item/available?aid=7x-ZtsJBsU3Gz1WpdDNtXKjVACw
43
+ body:
44
+ encoding: UTF-8
45
+ string: '{"PartnershipId":"BD","ExactSearch":[{"Type":"ISBN","Value":"1898989898"}]}'
46
+ headers:
47
+ User-Agent:
48
+ - ruby borrow_direct gem 1.2.0 (HTTPClient 2.6.0.1) https://github.com/jrochkind/borrow_direct
49
+ Accept:
50
+ - "*/*"
51
+ Date:
52
+ - Thu, 15 Oct 2015 15:14:45 GMT
53
+ Content-Type:
54
+ - application/json
55
+ Accept-Language:
56
+ - en
57
+ response:
58
+ status:
59
+ code: 404
60
+ message: Not Found
61
+ headers:
62
+ Server:
63
+ - nginx/1.4.1
64
+ Date:
65
+ - Thu, 15 Oct 2015 15:14:48 GMT
29
66
  Content-Type:
30
67
  - application/json;charset=UTF-8
31
68
  Transfer-Encoding:
@@ -33,18 +70,8 @@ http_interactions:
33
70
  Connection:
34
71
  - keep-alive
35
72
  body:
36
- encoding: US-ASCII
37
- string: ! '{"Item":{"Available":false,"SearchTerm":"isbn=NO_SUCH_THING","AuthorizationId":"7gkJbwWAwB6zYb3JVvX0BQbPiKc","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"]}}}'
73
+ encoding: UTF-8
74
+ string: '{"Problem":{"ErrorCode":"PUBFI002","ErrorMessage":"No result"}}'
48
75
  http_version:
49
- recorded_at: Tue, 21 Oct 2014 17:06:58 GMT
76
+ recorded_at: Thu, 15 Oct 2015 15:14:48 GMT
50
77
  recorded_with: VCR 2.9.3
@@ -2,17 +2,17 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://bdtest.relais-host.com/dws/item/available
5
+ uri: https://rc.relais-host.com/dws/item/available?aid=9mbA5poOXYxRq_U0-VpYxtNyUEU
6
6
  body:
7
7
  encoding: UTF-8
8
- string: ! '{"PartnershipId":"BD","Credentials":{"LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","Barcode":"DUMMY_BD_PATRON"},"ExactSearch":[{"Type":"ISBN","Value":"1441190090"}]}'
8
+ string: '{"PartnershipId":"BD","ExactSearch":[{"Type":"ISBN","Value":"9780143037248"}]}'
9
9
  headers:
10
10
  User-Agent:
11
- - ruby borrow_direct gem 0.0.1 (HTTPClient 2.5.1) https://github.com/jrochkind/borrow_direct
11
+ - ruby borrow_direct gem 1.2.0 (HTTPClient 2.6.0.1) https://github.com/jrochkind/borrow_direct
12
12
  Accept:
13
- - ! '*/*'
13
+ - "*/*"
14
14
  Date:
15
- - Tue, 21 Oct 2014 17:06:39 GMT
15
+ - Thu, 15 Oct 2015 15:15:26 GMT
16
16
  Content-Type:
17
17
  - application/json
18
18
  Accept-Language:
@@ -25,7 +25,7 @@ http_interactions:
25
25
  Server:
26
26
  - nginx/1.4.1
27
27
  Date:
28
- - Tue, 21 Oct 2014 17:06:41 GMT
28
+ - Thu, 15 Oct 2015 15:15:29 GMT
29
29
  Content-Type:
30
30
  - application/json;charset=UTF-8
31
31
  Transfer-Encoding:
@@ -33,18 +33,275 @@ http_interactions:
33
33
  Connection:
34
34
  - keep-alive
35
35
  body:
36
- encoding: US-ASCII
37
- string: ! '{"Item":{"Available":false,"SearchTerm":"isbn=1441190090","AuthorizationId":"5vwRvyoSAhh7-mlzzbyD6KPHo9c","RequestLink":{"ButtonLink":"http://findit.library.jhu.edu/resolve?genre=book","ButtonLabel":"Request","RequestMessage":"Borrow
36
+ encoding: UTF-8
37
+ string: '{"Available":true,"SearchTerm":"isbn=9780143037248","RequestLink":{"ButtonLink":"AddRequest","ButtonLabel":"Request","RequestMessage":"Request
38
+ this item"},"PickupLocation":[{"PickupLocationCode":"E","PickupLocationDescription":"*Milton
39
+ S. Eisenhower Library"},{"PickupLocationCode":"A","PickupLocationDescription":"Arthur
40
+ Friedheim Library"},{"PickupLocationCode":"B","PickupLocationDescription":"Columbia
41
+ Center"},{"PickupLocationCode":"C","PickupLocationDescription":"Harbor East"},{"PickupLocationCode":"D","PickupLocationDescription":"Montgomery
42
+ Library Resource Center"},{"PickupLocationCode":"F","PickupLocationDescription":"JHU
43
+ Homewood Office (faculty and grad students)"},{"PickupLocationCode":"G","PickupLocationDescription":"Washington
44
+ Library Resource Center"},{"PickupLocationCode":"H","PickupLocationDescription":"APL
45
+ - EP STUDENTS - Ed Center"},{"PickupLocationCode":"I","PickupLocationDescription":"APL
46
+ STAFF - Room 5-17"},{"PickupLocationCode":"J","PickupLocationDescription":"SAIS
47
+ Library"},{"PickupLocationCode":"K","PickupLocationDescription":"Harrison
48
+ Medical Library-Bayview"},{"PickupLocationCode":"L","PickupLocationDescription":"Institute
49
+ of the History of Medicine"},{"PickupLocationCode":"M","PickupLocationDescription":"JHMI
50
+ Pickup - Hampton House 9th floor"},{"PickupLocationCode":"N","PickupLocationDescription":"JHMI
51
+ Pickup - BSPH E4643"},{"PickupLocationCode":"O","PickupLocationDescription":"JHMI
52
+ Pickup - School of Nursing 313"},{"PickupLocationCode":"P","PickupLocationDescription":"JH
53
+ Medical Campus Office (faculty and staff)"},{"PickupLocationCode":"Q","PickupLocationDescription":"JHMI
54
+ Pickup - Armstrong 306"},{"PickupLocationCode":"R","PickupLocationDescription":"JHMI
55
+ Pickup - PCTB 115-116"},{"PickupLocationCode":"S","PickupLocationDescription":"Welch
56
+ Medical Library"},{"PickupLocationCode":"T","PickupLocationDescription":"Wilmer
57
+ Friedenwald Library"}]}'
58
+ http_version:
59
+ recorded_at: Thu, 15 Oct 2015 15:15:29 GMT
60
+ - request:
61
+ method: post
62
+ uri: https://rc.relais-host.com/dws/item/available?aid=Z5Z3L9jAgmJWaXrxQEHLN-YP_Yw
63
+ body:
64
+ encoding: UTF-8
65
+ string: '{"PartnershipId":"BD","ExactSearch":[{"Type":"ISBN","Value":"043783350X"}]}'
66
+ headers:
67
+ User-Agent:
68
+ - ruby borrow_direct gem 1.2.0 (HTTPClient 2.6.0.1) https://github.com/jrochkind/borrow_direct
69
+ Accept:
70
+ - "*/*"
71
+ Date:
72
+ - Thu, 15 Oct 2015 18:01:06 GMT
73
+ Content-Type:
74
+ - application/json
75
+ Accept-Language:
76
+ - en
77
+ response:
78
+ status:
79
+ code: 200
80
+ message: OK
81
+ headers:
82
+ Server:
83
+ - nginx/1.4.1
84
+ Date:
85
+ - Thu, 15 Oct 2015 18:01:18 GMT
86
+ Content-Type:
87
+ - application/json;charset=UTF-8
88
+ Transfer-Encoding:
89
+ - chunked
90
+ Connection:
91
+ - keep-alive
92
+ body:
93
+ encoding: UTF-8
94
+ string: '{"Available":true,"SearchTerm":"isbn=043783350X","RequestLink":{"ButtonLink":"AddRequest","ButtonLabel":"Request","RequestMessage":"Request
95
+ this item"},"PickupLocation":[{"PickupLocationCode":"E","PickupLocationDescription":"*Milton
96
+ S. Eisenhower Library"},{"PickupLocationCode":"A","PickupLocationDescription":"Arthur
97
+ Friedheim Library"},{"PickupLocationCode":"B","PickupLocationDescription":"Columbia
98
+ Center"},{"PickupLocationCode":"C","PickupLocationDescription":"Harbor East"},{"PickupLocationCode":"D","PickupLocationDescription":"Montgomery
99
+ Library Resource Center"},{"PickupLocationCode":"F","PickupLocationDescription":"JHU
100
+ Homewood Office (faculty and grad students)"},{"PickupLocationCode":"G","PickupLocationDescription":"Washington
101
+ Library Resource Center"},{"PickupLocationCode":"H","PickupLocationDescription":"APL
102
+ - EP STUDENTS - Ed Center"},{"PickupLocationCode":"I","PickupLocationDescription":"APL
103
+ STAFF - Room 5-17"},{"PickupLocationCode":"J","PickupLocationDescription":"SAIS
104
+ Library"},{"PickupLocationCode":"K","PickupLocationDescription":"Harrison
105
+ Medical Library-Bayview"},{"PickupLocationCode":"L","PickupLocationDescription":"Institute
106
+ of the History of Medicine"},{"PickupLocationCode":"M","PickupLocationDescription":"JHMI
107
+ Pickup - Hampton House 9th floor"},{"PickupLocationCode":"N","PickupLocationDescription":"JHMI
108
+ Pickup - BSPH E4643"},{"PickupLocationCode":"O","PickupLocationDescription":"JHMI
109
+ Pickup - School of Nursing 313"},{"PickupLocationCode":"P","PickupLocationDescription":"JH
110
+ Medical Campus Office (faculty and staff)"},{"PickupLocationCode":"Q","PickupLocationDescription":"JHMI
111
+ Pickup - Armstrong 306"},{"PickupLocationCode":"R","PickupLocationDescription":"JHMI
112
+ Pickup - PCTB 115-116"},{"PickupLocationCode":"S","PickupLocationDescription":"Welch
113
+ Medical Library"},{"PickupLocationCode":"T","PickupLocationDescription":"Wilmer
114
+ Friedenwald Library"}]}'
115
+ http_version:
116
+ recorded_at: Thu, 15 Oct 2015 18:01:18 GMT
117
+ - request:
118
+ method: post
119
+ uri: https://rc.relais-host.com/dws/item/available?aid=fAHKNER_ZPLjI7wlNdFQTJsHjVI
120
+ body:
121
+ encoding: UTF-8
122
+ string: '{"PartnershipId":"BD","ExactSearch":[{"Type":"ISBN","Value":"0060258187"}]}'
123
+ headers:
124
+ User-Agent:
125
+ - ruby borrow_direct gem 1.2.0 (HTTPClient 2.6.0.1) https://github.com/jrochkind/borrow_direct
126
+ Accept:
127
+ - "*/*"
128
+ Date:
129
+ - Thu, 15 Oct 2015 18:02:47 GMT
130
+ Content-Type:
131
+ - application/json
132
+ Accept-Language:
133
+ - en
134
+ response:
135
+ status:
136
+ code: 200
137
+ message: OK
138
+ headers:
139
+ Server:
140
+ - nginx/1.4.1
141
+ Date:
142
+ - Thu, 15 Oct 2015 18:02:49 GMT
143
+ Content-Type:
144
+ - application/json;charset=UTF-8
145
+ Transfer-Encoding:
146
+ - chunked
147
+ Connection:
148
+ - keep-alive
149
+ body:
150
+ encoding: UTF-8
151
+ string: '{"Available":true,"SearchTerm":"isbn=0060258187","RequestLink":{"ButtonLink":"AddRequest","ButtonLabel":"Request","RequestMessage":"Request
152
+ this item"},"PickupLocation":[{"PickupLocationCode":"E","PickupLocationDescription":"*Milton
153
+ S. Eisenhower Library"},{"PickupLocationCode":"A","PickupLocationDescription":"Arthur
154
+ Friedheim Library"},{"PickupLocationCode":"B","PickupLocationDescription":"Columbia
155
+ Center"},{"PickupLocationCode":"C","PickupLocationDescription":"Harbor East"},{"PickupLocationCode":"D","PickupLocationDescription":"Montgomery
156
+ Library Resource Center"},{"PickupLocationCode":"F","PickupLocationDescription":"JHU
157
+ Homewood Office (faculty and grad students)"},{"PickupLocationCode":"G","PickupLocationDescription":"Washington
158
+ Library Resource Center"},{"PickupLocationCode":"H","PickupLocationDescription":"APL
159
+ - EP STUDENTS - Ed Center"},{"PickupLocationCode":"I","PickupLocationDescription":"APL
160
+ STAFF - Room 5-17"},{"PickupLocationCode":"J","PickupLocationDescription":"SAIS
161
+ Library"},{"PickupLocationCode":"K","PickupLocationDescription":"Harrison
162
+ Medical Library-Bayview"},{"PickupLocationCode":"L","PickupLocationDescription":"Institute
163
+ of the History of Medicine"},{"PickupLocationCode":"M","PickupLocationDescription":"JHMI
164
+ Pickup - Hampton House 9th floor"},{"PickupLocationCode":"N","PickupLocationDescription":"JHMI
165
+ Pickup - BSPH E4643"},{"PickupLocationCode":"O","PickupLocationDescription":"JHMI
166
+ Pickup - School of Nursing 313"},{"PickupLocationCode":"P","PickupLocationDescription":"JH
167
+ Medical Campus Office (faculty and staff)"},{"PickupLocationCode":"Q","PickupLocationDescription":"JHMI
168
+ Pickup - Armstrong 306"},{"PickupLocationCode":"R","PickupLocationDescription":"JHMI
169
+ Pickup - PCTB 115-116"},{"PickupLocationCode":"S","PickupLocationDescription":"Welch
170
+ Medical Library"},{"PickupLocationCode":"T","PickupLocationDescription":"Wilmer
171
+ Friedenwald Library"}]}'
172
+ http_version:
173
+ recorded_at: Thu, 15 Oct 2015 18:02:49 GMT
174
+ - request:
175
+ method: post
176
+ uri: https://rc.relais-host.com/dws/item/available?aid=vYVghtywBLTMAuQiCeJ_GCzxu_s
177
+ body:
178
+ encoding: UTF-8
179
+ string: '{"PartnershipId":"BD","ExactSearch":[{"Type":"ISBN","Value":"0517514028"}]}'
180
+ headers:
181
+ User-Agent:
182
+ - ruby borrow_direct gem 1.2.0 (HTTPClient 2.6.0.1) https://github.com/jrochkind/borrow_direct
183
+ Accept:
184
+ - "*/*"
185
+ Date:
186
+ - Thu, 15 Oct 2015 18:02:57 GMT
187
+ Content-Type:
188
+ - application/json
189
+ Accept-Language:
190
+ - en
191
+ response:
192
+ status:
193
+ code: 200
194
+ message: OK
195
+ headers:
196
+ Server:
197
+ - nginx/1.4.1
198
+ Date:
199
+ - Thu, 15 Oct 2015 18:03:05 GMT
200
+ Content-Type:
201
+ - application/json;charset=UTF-8
202
+ Transfer-Encoding:
203
+ - chunked
204
+ Connection:
205
+ - keep-alive
206
+ body:
207
+ encoding: UTF-8
208
+ string: '{"Available":true,"SearchTerm":"isbn=0517514028","RequestLink":{"ButtonLink":"AddRequest","ButtonLabel":"Request","RequestMessage":"Request
209
+ this item"},"PickupLocation":[{"PickupLocationCode":"E","PickupLocationDescription":"*Milton
210
+ S. Eisenhower Library"},{"PickupLocationCode":"A","PickupLocationDescription":"Arthur
211
+ Friedheim Library"},{"PickupLocationCode":"B","PickupLocationDescription":"Columbia
212
+ Center"},{"PickupLocationCode":"C","PickupLocationDescription":"Harbor East"},{"PickupLocationCode":"D","PickupLocationDescription":"Montgomery
213
+ Library Resource Center"},{"PickupLocationCode":"F","PickupLocationDescription":"JHU
214
+ Homewood Office (faculty and grad students)"},{"PickupLocationCode":"G","PickupLocationDescription":"Washington
215
+ Library Resource Center"},{"PickupLocationCode":"H","PickupLocationDescription":"APL
216
+ - EP STUDENTS - Ed Center"},{"PickupLocationCode":"I","PickupLocationDescription":"APL
217
+ STAFF - Room 5-17"},{"PickupLocationCode":"J","PickupLocationDescription":"SAIS
218
+ Library"},{"PickupLocationCode":"K","PickupLocationDescription":"Harrison
219
+ Medical Library-Bayview"},{"PickupLocationCode":"L","PickupLocationDescription":"Institute
220
+ of the History of Medicine"},{"PickupLocationCode":"M","PickupLocationDescription":"JHMI
221
+ Pickup - Hampton House 9th floor"},{"PickupLocationCode":"N","PickupLocationDescription":"JHMI
222
+ Pickup - BSPH E4643"},{"PickupLocationCode":"O","PickupLocationDescription":"JHMI
223
+ Pickup - School of Nursing 313"},{"PickupLocationCode":"P","PickupLocationDescription":"JH
224
+ Medical Campus Office (faculty and staff)"},{"PickupLocationCode":"Q","PickupLocationDescription":"JHMI
225
+ Pickup - Armstrong 306"},{"PickupLocationCode":"R","PickupLocationDescription":"JHMI
226
+ Pickup - PCTB 115-116"},{"PickupLocationCode":"S","PickupLocationDescription":"Welch
227
+ Medical Library"},{"PickupLocationCode":"T","PickupLocationDescription":"Wilmer
228
+ Friedenwald Library"}]}'
229
+ http_version:
230
+ recorded_at: Thu, 15 Oct 2015 18:03:05 GMT
231
+ - request:
232
+ method: post
233
+ uri: https://rc.relais-host.com/portal-service/user/authentication
234
+ body:
235
+ encoding: UTF-8
236
+ string: '{"ApiKey":"DUMMY_BD_API_KEY","PartnershipId":"BD","UserGroup":"patron","LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","PatronId":"DUMMY_BD_PATRON"}'
237
+ headers:
238
+ User-Agent:
239
+ - ruby borrow_direct gem 1.2.0 (HTTPClient 2.6.0.1) https://github.com/jrochkind/borrow_direct
240
+ Accept:
241
+ - "*/*"
242
+ Date:
243
+ - Thu, 15 Oct 2015 18:04:52 GMT
244
+ Content-Type:
245
+ - application/json
246
+ Accept-Language:
247
+ - en
248
+ response:
249
+ status:
250
+ code: 200
251
+ message: OK
252
+ headers:
253
+ Server:
254
+ - nginx/1.4.1
255
+ Date:
256
+ - Thu, 15 Oct 2015 18:04:53 GMT
257
+ Content-Type:
258
+ - application/json;charset=UTF-8
259
+ Content-Length:
260
+ - '269'
261
+ Connection:
262
+ - keep-alive
263
+ body:
264
+ encoding: UTF-8
265
+ string: '{"AuthorizationId":"384hRfyh18S-VjZwm0jX4l5zQrk","LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","Iso639_2_LangCode":"ENG","FirstName":"Jonathan","LastName":"Rochkind","AllowLoanAddRequest":true,"AllowCopyAddRequest":false,"AllowSelDelivLoanChange":true,"AllowSelDelivCopyChange":false}'
266
+ http_version:
267
+ recorded_at: Thu, 15 Oct 2015 18:04:53 GMT
268
+ - request:
269
+ method: post
270
+ uri: https://rc.relais-host.com/dws/item/available?aid=384hRfyh18S-VjZwm0jX4l5zQrk
271
+ body:
272
+ encoding: UTF-8
273
+ string: '{"PartnershipId":"BD","ExactSearch":[{"Type":"ISBN","Value":"1444367072"}]}'
274
+ headers:
275
+ User-Agent:
276
+ - ruby borrow_direct gem 1.2.0 (HTTPClient 2.6.0.1) https://github.com/jrochkind/borrow_direct
277
+ Accept:
278
+ - "*/*"
279
+ Date:
280
+ - Thu, 15 Oct 2015 18:04:53 GMT
281
+ Content-Type:
282
+ - application/json
283
+ Accept-Language:
284
+ - en
285
+ response:
286
+ status:
287
+ code: 200
288
+ message: OK
289
+ headers:
290
+ Server:
291
+ - nginx/1.4.1
292
+ Date:
293
+ - Thu, 15 Oct 2015 18:04:56 GMT
294
+ Content-Type:
295
+ - application/json;charset=UTF-8
296
+ Transfer-Encoding:
297
+ - chunked
298
+ Connection:
299
+ - keep-alive
300
+ body:
301
+ encoding: UTF-8
302
+ string: '{"Available":false,"SearchTerm":"isbn=1444367072","RequestLink":{"ButtonLink":"http://findit.library.jhu.edu/resolve?genre=Book&sid=BD&HeldLocally=N&rft.title=International%20encyclopedia%20of%20ethics&rft.date=2013&rft.isbn=9781444367072%20%28electronic%20bk.%29\n&rft.isbn=1444367072%20%28electronic%20bk.%29&rft.dat=829259960&rft.pub=Wiley-Blackwell&rft.place=Malden%2C%20MA","ButtonLabel":"Request","RequestMessage":"Borrow
38
303
  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"]}}}'
304
+ Loan."}}'
48
305
  http_version:
49
- recorded_at: Tue, 21 Oct 2014 17:06:41 GMT
306
+ recorded_at: Thu, 15 Oct 2015 18:04:56 GMT
50
307
  recorded_with: VCR 2.9.3
@@ -2,17 +2,17 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://bdtest.relais-host.com/dws/item/available
5
+ uri: https://rc.relais-host.com/portal-service/user/authentication
6
6
  body:
7
7
  encoding: UTF-8
8
- string: ! '{"PartnershipId":"BD","Credentials":{"LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","Barcode":"DUMMY_BD_PATRON"},"ExactSearch":[{"Type":"ISBN","Value":"0745649890"}]}'
8
+ string: '{"ApiKey":"DUMMY_BD_API_KEY","PartnershipId":"BD","UserGroup":"patron","LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","PatronId":"DUMMY_BD_PATRON"}'
9
9
  headers:
10
10
  User-Agent:
11
- - ruby borrow_direct gem 0.0.1 (HTTPClient 2.5.1) https://github.com/jrochkind/borrow_direct
11
+ - ruby borrow_direct gem 1.2.0 (HTTPClient 2.6.0.1) https://github.com/jrochkind/borrow_direct
12
12
  Accept:
13
- - ! '*/*'
13
+ - "*/*"
14
14
  Date:
15
- - Tue, 21 Oct 2014 17:06:58 GMT
15
+ - Thu, 15 Oct 2015 15:15:29 GMT
16
16
  Content-Type:
17
17
  - application/json
18
18
  Accept-Language:
@@ -25,7 +25,44 @@ http_interactions:
25
25
  Server:
26
26
  - nginx/1.4.1
27
27
  Date:
28
- - Tue, 21 Oct 2014 17:07:00 GMT
28
+ - Thu, 15 Oct 2015 15:15:30 GMT
29
+ Content-Type:
30
+ - application/json;charset=UTF-8
31
+ Content-Length:
32
+ - '269'
33
+ Connection:
34
+ - keep-alive
35
+ body:
36
+ encoding: UTF-8
37
+ string: '{"AuthorizationId":"CubSDw5zCnLwXCGE0haF2_AVMWg","LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","Iso639_2_LangCode":"ENG","FirstName":"Jonathan","LastName":"Rochkind","AllowLoanAddRequest":true,"AllowCopyAddRequest":false,"AllowSelDelivLoanChange":true,"AllowSelDelivCopyChange":false}'
38
+ http_version:
39
+ recorded_at: Thu, 15 Oct 2015 15:15:30 GMT
40
+ - request:
41
+ method: post
42
+ uri: https://rc.relais-host.com/dws/item/available?aid=CubSDw5zCnLwXCGE0haF2_AVMWg
43
+ body:
44
+ encoding: UTF-8
45
+ string: '{"PartnershipId":"BD","ExactSearch":[{"Type":"ISBN","Value":"0745649890"}]}'
46
+ headers:
47
+ User-Agent:
48
+ - ruby borrow_direct gem 1.2.0 (HTTPClient 2.6.0.1) https://github.com/jrochkind/borrow_direct
49
+ Accept:
50
+ - "*/*"
51
+ Date:
52
+ - Thu, 15 Oct 2015 15:15:30 GMT
53
+ Content-Type:
54
+ - application/json
55
+ Accept-Language:
56
+ - en
57
+ response:
58
+ status:
59
+ code: 200
60
+ message: OK
61
+ headers:
62
+ Server:
63
+ - nginx/1.4.1
64
+ Date:
65
+ - Thu, 15 Oct 2015 15:15:33 GMT
29
66
  Content-Type:
30
67
  - application/json;charset=UTF-8
31
68
  Transfer-Encoding:
@@ -33,17 +70,9 @@ http_interactions:
33
70
  Connection:
34
71
  - keep-alive
35
72
  body:
36
- encoding: US-ASCII
37
- string: ! '{"Item":{"Available":true,"SearchTerm":"isbn=0745649890","AuthorizationId":"ZRjcyvCAvMV7hbuXkUJmSjlGeQI","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"]}}}'
73
+ encoding: UTF-8
74
+ string: '{"Available":false,"SearchTerm":"isbn=0745649890","RequestLink":{"ButtonLink":"https://blacklight.library.jhu.edu/catalyst_demo/catalog/bib_4733731","ButtonLabel":"Find
75
+ item","RequestMessage":"This item is available locally."}}'
47
76
  http_version:
48
- recorded_at: Tue, 21 Oct 2014 17:07:00 GMT
77
+ recorded_at: Thu, 15 Oct 2015 15:15:33 GMT
49
78
  recorded_with: VCR 2.9.3
@@ -2,17 +2,17 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://bdtest.relais-host.com/dws/item/available
5
+ uri: https://rc.relais-host.com/portal-service/user/authentication
6
6
  body:
7
7
  encoding: UTF-8
8
- string: ! '{"PartnershipId":"BD","Credentials":{"LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","Barcode":"DUMMY_BD_PATRON"},"ExactSearch":[{"Type":"ISBN","Value":"9810743734"}]}'
8
+ string: '{"ApiKey":"DUMMY_BD_API_KEY","PartnershipId":"BD","UserGroup":"patron","LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","PatronId":"DUMMY_BD_PATRON"}'
9
9
  headers:
10
10
  User-Agent:
11
- - ruby borrow_direct gem 0.0.1 (HTTPClient 2.5.1) https://github.com/jrochkind/borrow_direct
11
+ - ruby borrow_direct gem 1.2.0 (HTTPClient 2.6.0.1) https://github.com/jrochkind/borrow_direct
12
12
  Accept:
13
- - ! '*/*'
13
+ - "*/*"
14
14
  Date:
15
- - Tue, 21 Oct 2014 17:06:32 GMT
15
+ - Thu, 15 Oct 2015 15:15:15 GMT
16
16
  Content-Type:
17
17
  - application/json
18
18
  Accept-Language:
@@ -25,7 +25,44 @@ http_interactions:
25
25
  Server:
26
26
  - nginx/1.4.1
27
27
  Date:
28
- - Tue, 21 Oct 2014 17:06:34 GMT
28
+ - Thu, 15 Oct 2015 15:15:16 GMT
29
+ Content-Type:
30
+ - application/json;charset=UTF-8
31
+ Content-Length:
32
+ - '269'
33
+ Connection:
34
+ - keep-alive
35
+ body:
36
+ encoding: UTF-8
37
+ string: '{"AuthorizationId":"2ttLBgTU9rvIiIIGFDtp-Rd5U6c","LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","Iso639_2_LangCode":"ENG","FirstName":"Jonathan","LastName":"Rochkind","AllowLoanAddRequest":true,"AllowCopyAddRequest":false,"AllowSelDelivLoanChange":true,"AllowSelDelivCopyChange":false}'
38
+ http_version:
39
+ recorded_at: Thu, 15 Oct 2015 15:15:16 GMT
40
+ - request:
41
+ method: post
42
+ uri: https://rc.relais-host.com/dws/item/available?aid=2ttLBgTU9rvIiIIGFDtp-Rd5U6c
43
+ body:
44
+ encoding: UTF-8
45
+ string: '{"PartnershipId":"BD","ExactSearch":[{"Type":"ISBN","Value":"9810743734"}]}'
46
+ headers:
47
+ User-Agent:
48
+ - ruby borrow_direct gem 1.2.0 (HTTPClient 2.6.0.1) https://github.com/jrochkind/borrow_direct
49
+ Accept:
50
+ - "*/*"
51
+ Date:
52
+ - Thu, 15 Oct 2015 15:15:16 GMT
53
+ Content-Type:
54
+ - application/json
55
+ Accept-Language:
56
+ - en
57
+ response:
58
+ status:
59
+ code: 200
60
+ message: OK
61
+ headers:
62
+ Server:
63
+ - nginx/1.4.1
64
+ Date:
65
+ - Thu, 15 Oct 2015 15:15:19 GMT
29
66
  Content-Type:
30
67
  - application/json;charset=UTF-8
31
68
  Transfer-Encoding:
@@ -33,17 +70,28 @@ http_interactions:
33
70
  Connection:
34
71
  - keep-alive
35
72
  body:
36
- encoding: US-ASCII
37
- string: ! '{"Item":{"Available":true,"SearchTerm":"isbn=9810743734","AuthorizationId":"6k7DO5-7e8a_vKqvhXus9fIxJ0c","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"]}}}'
73
+ encoding: UTF-8
74
+ string: '{"Available":true,"SearchTerm":"isbn=9810743734","RequestLink":{"ButtonLink":"AddRequest","ButtonLabel":"Request","RequestMessage":"Request
75
+ this item"},"PickupLocation":[{"PickupLocationCode":"E","PickupLocationDescription":"*Milton
76
+ S. Eisenhower Library"},{"PickupLocationCode":"A","PickupLocationDescription":"Arthur
77
+ Friedheim Library"},{"PickupLocationCode":"B","PickupLocationDescription":"Columbia
78
+ Center"},{"PickupLocationCode":"C","PickupLocationDescription":"Harbor East"},{"PickupLocationCode":"D","PickupLocationDescription":"Montgomery
79
+ Library Resource Center"},{"PickupLocationCode":"F","PickupLocationDescription":"JHU
80
+ Homewood Office (faculty and grad students)"},{"PickupLocationCode":"G","PickupLocationDescription":"Washington
81
+ Library Resource Center"},{"PickupLocationCode":"H","PickupLocationDescription":"APL
82
+ - EP STUDENTS - Ed Center"},{"PickupLocationCode":"I","PickupLocationDescription":"APL
83
+ STAFF - Room 5-17"},{"PickupLocationCode":"J","PickupLocationDescription":"SAIS
84
+ Library"},{"PickupLocationCode":"K","PickupLocationDescription":"Harrison
85
+ Medical Library-Bayview"},{"PickupLocationCode":"L","PickupLocationDescription":"Institute
86
+ of the History of Medicine"},{"PickupLocationCode":"M","PickupLocationDescription":"JHMI
87
+ Pickup - Hampton House 9th floor"},{"PickupLocationCode":"N","PickupLocationDescription":"JHMI
88
+ Pickup - BSPH E4643"},{"PickupLocationCode":"O","PickupLocationDescription":"JHMI
89
+ Pickup - School of Nursing 313"},{"PickupLocationCode":"P","PickupLocationDescription":"JH
90
+ Medical Campus Office (faculty and staff)"},{"PickupLocationCode":"Q","PickupLocationDescription":"JHMI
91
+ Pickup - Armstrong 306"},{"PickupLocationCode":"R","PickupLocationDescription":"JHMI
92
+ Pickup - PCTB 115-116"},{"PickupLocationCode":"S","PickupLocationDescription":"Welch
93
+ Medical Library"},{"PickupLocationCode":"T","PickupLocationDescription":"Wilmer
94
+ Friedenwald Library"}]}'
47
95
  http_version:
48
- recorded_at: Tue, 21 Oct 2014 17:06:34 GMT
96
+ recorded_at: Thu, 15 Oct 2015 15:15:19 GMT
49
97
  recorded_with: VCR 2.9.3