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,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:05:58 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:01 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":"d_u5EiN_dfK87HMDmeuCzSFqcp0","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:01 GMT
49
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,41 @@
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":"BAD_ID","Credentials":{"LibrarySymbol":"librarySymbol","Barcode":"barcode/patronId"},"ExactSearch":[{"Type":"type","Value":"value"}]}'
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:58 GMT
16
+ Content-Type:
17
+ - application/json
18
+ Accept-Language:
19
+ - en
20
+ response:
21
+ status:
22
+ code: 500
23
+ message: Server Error
24
+ headers:
25
+ Server:
26
+ - nginx/1.4.1
27
+ Date:
28
+ - Tue, 21 Oct 2014 17:05:58 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":"PUBFI003","ErrorMessage":"Invalid PartnershipId:
38
+ BAD_ID"}}'
39
+ http_version:
40
+ recorded_at: Tue, 21 Oct 2014 17:05:58 GMT
41
+ 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/no/such/path
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"foo":"bar"}'
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: 404
23
+ message: Not Found
24
+ headers:
25
+ Server:
26
+ - nginx/1.4.1
27
+ Date:
28
+ - Tue, 21 Oct 2014 17:06:01 GMT
29
+ Content-Type:
30
+ - text/html; charset=UTF-8
31
+ Content-Length:
32
+ - '1605'
33
+ Connection:
34
+ - keep-alive
35
+ Etag:
36
+ - ! '"5411bb96-645"'
37
+ body:
38
+ encoding: US-ASCII
39
+ string: ! "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"UTF-8\">\n<link
40
+ rel=\"icon\" href=\"/img/favicon-3.13.4-HOTFIX-RELEASE.ico\" type=\"image/x-icon\"
41
+ />\n<link rel=\"shortcut icon\" href=\"/img/favicon-3.13.4-HOTFIX-RELEASE.ico\"
42
+ type=\"image/x-icon\" />\n<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/jquery-ui-1.10.3.custom.css\"
43
+ />\n<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/portalUI-Core-3.13.4-HOTFIX-RELEASE.css\"
44
+ />\n<script type=\"text/javascript\" src=\"/js/head.core.min-v1.0.2.js\"></script>\n<script
45
+ type=\"text/javascript\" src=\"/js/portalAir-3.13.4-HOTFIX-RELEASE.js\"></script>\n<title></title>\n</head>\n<body>\n\t<div
46
+ id=\"divPage\">\n\t\t<div id=\"divHeader\">\n\t\t\t<div id=\"Header\">&nbsp;
47
+ </div>\n\t\t\t<div id=\"ErrorMenu\">&nbsp; </div>\n\t\t</div>\n\t\t\n\t\t<div
48
+ id=\"divContent\">\n\t\t\t<div id=\"Error404\">&nbsp; </div>\n\t\t</div> <!--
49
+ End div Content -->\n\t\t\n\t\t<div id=\"divFooter\">\n\t\t\t<div id=\"Footer\">&nbsp;
50
+ </div>\n\t\t</div>\n\n\t</div> <!-- End DivPage -->\n\n\t<script>\n\thead.js(\"/js/portalComponent-3.13.4-HOTFIX-RELEASE.js\",\"/htc/commonCompObj-3.13.4-HOTFIX-RELEASE.js\",\"/err/htc/errorMenuCompObj-3.13.4-HOTFIX-RELEASE.js\",\"/err/htc/error404CompObj-3.13.4-HOTFIX-RELEASE.js\",\"/htc/headerCompObj-3.13.4-HOTFIX-RELEASE.js\");\n\t\n\thead.js(\"/js/jquery.min-v1.10.1.js\",\"/js/jquery.ui.min-v1.10.3.js\",\"/js/jquery.dataset-v0.1.0.js\",\"/js/URI-v1.13.1.js\",\"/js/sessionstorage.js\",\"/js/jquery.timer.js\",\n\t\"/js/portalService-3.13.4-HOTFIX-RELEASE.js\",\"/js/portalForm-3.13.4-HOTFIX-RELEASE.js\",\"/js/portalUI-Core-3.13.4-HOTFIX-RELEASE.js\",\"/err/htc/errorBLL-3.13.4-HOTFIX-RELEASE.js\",function(){\n\t\tportalError.setUpOp404();\n\t});\n\t</script>\n</body>\n</html>"
51
+ http_version:
52
+ recorded_at: Tue, 21 Oct 2014 17:06:01 GMT
53
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,63 @@
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: ! '{"foo":"bar"}'
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:58 GMT
16
+ Content-Type:
17
+ - application/json
18
+ Accept-Language:
19
+ - en
20
+ response:
21
+ status:
22
+ code: 400
23
+ message: Bad Request
24
+ headers:
25
+ Server:
26
+ - nginx/1.4.1
27
+ Date:
28
+ - Tue, 21 Oct 2014 17:05:58 GMT
29
+ Content-Type:
30
+ - text/html; charset=ISO-8859-1
31
+ Content-Length:
32
+ - '306'
33
+ Connection:
34
+ - keep-alive
35
+ Cache-Control:
36
+ - must-revalidate,no-cache,no-store
37
+ body:
38
+ encoding: US-ASCII
39
+ string: ! '<html>
40
+
41
+ <head>
42
+
43
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
44
+
45
+ <title>Error 400 Bad Request</title>
46
+
47
+ </head>
48
+
49
+ <body><h2>HTTP ERROR 400</h2>
50
+
51
+ <p>Problem accessing /dws/item/available. Reason:
52
+
53
+ <pre> Bad Request</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>
54
+
55
+
56
+ </body>
57
+
58
+ </html>
59
+
60
+ '
61
+ http_version:
62
+ recorded_at: Tue, 21 Oct 2014 17:05:58 GMT
63
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,41 @@
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":"BAD_ID","Credentials":{"LibrarySymbol":"librarySymbol","Barcode":"barcode/patronId"},"ExactSearch":[{"Type":"type","Value":"value"}]}'
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:44 GMT
16
+ Content-Type:
17
+ - application/json
18
+ Accept-Language:
19
+ - en
20
+ response:
21
+ status:
22
+ code: 500
23
+ message: Server Error
24
+ headers:
25
+ Server:
26
+ - nginx/1.4.1
27
+ Date:
28
+ - Tue, 21 Oct 2014 17:05:45 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":"PUBFI003","ErrorMessage":"Invalid PartnershipId:
38
+ BAD_ID"}}'
39
+ http_version:
40
+ recorded_at: Tue, 21 Oct 2014 17:05:45 GMT
41
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,90 @@
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:05:27 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:05:28 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":"WFWwKG5vIgL2fVNsZJg_tHwRe9w","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:05:28 GMT
52
+ - request:
53
+ method: post
54
+ uri: https://bdtest.relais-host.com/dws/item/add
55
+ body:
56
+ encoding: UTF-8
57
+ string: ! '{"PartnershipId":"BD","AuthorizationId":"WFWwKG5vIgL2fVNsZJg_tHwRe9w","PickupLocation":null,"ExactSearch":[{"Type":"ISBN","Value":"0745649890"}]}'
58
+ headers:
59
+ User-Agent:
60
+ - ruby borrow_direct gem 0.0.1 (HTTPClient 2.5.1) https://github.com/jrochkind/borrow_direct
61
+ Accept:
62
+ - ! '*/*'
63
+ Date:
64
+ - Tue, 21 Oct 2014 17:05:28 GMT
65
+ Content-Type:
66
+ - application/json
67
+ Accept-Language:
68
+ - en
69
+ response:
70
+ status:
71
+ code: 200
72
+ message: OK
73
+ headers:
74
+ Server:
75
+ - nginx/1.4.1
76
+ Date:
77
+ - Tue, 21 Oct 2014 17:05:31 GMT
78
+ Content-Type:
79
+ - application/json;charset=UTF-8
80
+ Transfer-Encoding:
81
+ - chunked
82
+ Connection:
83
+ - keep-alive
84
+ body:
85
+ encoding: US-ASCII
86
+ string: ! '{"Request":{"RequestLink":{"RequestMessage":"This item is available
87
+ locally"}}}'
88
+ http_version:
89
+ recorded_at: Tue, 21 Oct 2014 17:05:31 GMT
90
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,89 @@
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:05: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:05: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":"nNQr6AMAFcDSMvvt95QKf7Cxvns","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:05:23 GMT
52
+ - request:
53
+ method: post
54
+ uri: https://bdtest.relais-host.com/dws/item/add
55
+ body:
56
+ encoding: UTF-8
57
+ string: ! '{"PartnershipId":"BD","AuthorizationId":"nNQr6AMAFcDSMvvt95QKf7Cxvns","PickupLocation":null,"ExactSearch":[{"Type":"ISBN","Value":"9797994864"}]}'
58
+ headers:
59
+ User-Agent:
60
+ - ruby borrow_direct gem 0.0.1 (HTTPClient 2.5.1) https://github.com/jrochkind/borrow_direct
61
+ Accept:
62
+ - ! '*/*'
63
+ Date:
64
+ - Tue, 21 Oct 2014 17:05:23 GMT
65
+ Content-Type:
66
+ - application/json
67
+ Accept-Language:
68
+ - en
69
+ response:
70
+ status:
71
+ code: 200
72
+ message: OK
73
+ headers:
74
+ Server:
75
+ - nginx/1.4.1
76
+ Date:
77
+ - Tue, 21 Oct 2014 17:05:27 GMT
78
+ Content-Type:
79
+ - application/json;charset=UTF-8
80
+ Transfer-Encoding:
81
+ - chunked
82
+ Connection:
83
+ - keep-alive
84
+ body:
85
+ encoding: US-ASCII
86
+ string: ! '{"Request":{"RequestNumber":"JHU-99000778"}}'
87
+ http_version:
88
+ recorded_at: Tue, 21 Oct 2014 17:05:27 GMT
89
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,91 @@
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:05: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:05: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":"Auq_bjv08rLoRua0xY7GvulZOD0","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:05:19 GMT
52
+ - request:
53
+ method: post
54
+ uri: https://bdtest.relais-host.com/dws/item/add
55
+ body:
56
+ encoding: UTF-8
57
+ string: ! '{"PartnershipId":"BD","AuthorizationId":"Auq_bjv08rLoRua0xY7GvulZOD0","PickupLocation":null,"ExactSearch":[{"Type":"ISBN","Value":"1441190090"}]}'
58
+ headers:
59
+ User-Agent:
60
+ - ruby borrow_direct gem 0.0.1 (HTTPClient 2.5.1) https://github.com/jrochkind/borrow_direct
61
+ Accept:
62
+ - ! '*/*'
63
+ Date:
64
+ - Tue, 21 Oct 2014 17:05:19 GMT
65
+ Content-Type:
66
+ - application/json
67
+ Accept-Language:
68
+ - en
69
+ response:
70
+ status:
71
+ code: 200
72
+ message: OK
73
+ headers:
74
+ Server:
75
+ - nginx/1.4.1
76
+ Date:
77
+ - Tue, 21 Oct 2014 17:05:22 GMT
78
+ Content-Type:
79
+ - application/json;charset=UTF-8
80
+ Transfer-Encoding:
81
+ - chunked
82
+ Connection:
83
+ - keep-alive
84
+ body:
85
+ encoding: US-ASCII
86
+ string: ! '{"Request":{"RequestLink":{"ButtonLabel":"Request","ButtonLink":"http://findit.library.jhu.edu/resolve?genre=book","RequestMessage":"Borrow
87
+ Direct cannot fill this request at this time. Please request through Interlibrary
88
+ Loan."}}}'
89
+ http_version:
90
+ recorded_at: Tue, 21 Oct 2014 17:05:22 GMT
91
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,91 @@
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:05:42 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:05:44 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":"mHVG8a1xWjUEVhUSxmlJSVFoaLY","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:05:44 GMT
52
+ - request:
53
+ method: post
54
+ uri: https://bdtest.relais-host.com/dws/item/add
55
+ body:
56
+ encoding: UTF-8
57
+ string: ! '{"PartnershipId":"BD","AuthorizationId":"mHVG8a1xWjUEVhUSxmlJSVFoaLY","PickupLocation":null,"ExactSearch":[{"Type":"ISBN","Value":"1441190090"}]}'
58
+ headers:
59
+ User-Agent:
60
+ - ruby borrow_direct gem 0.0.1 (HTTPClient 2.5.1) https://github.com/jrochkind/borrow_direct
61
+ Accept:
62
+ - ! '*/*'
63
+ Date:
64
+ - Tue, 21 Oct 2014 17:05:44 GMT
65
+ Content-Type:
66
+ - application/json
67
+ Accept-Language:
68
+ - en
69
+ response:
70
+ status:
71
+ code: 200
72
+ message: OK
73
+ headers:
74
+ Server:
75
+ - nginx/1.4.1
76
+ Date:
77
+ - Tue, 21 Oct 2014 17:05:44 GMT
78
+ Content-Type:
79
+ - application/json;charset=UTF-8
80
+ Transfer-Encoding:
81
+ - chunked
82
+ Connection:
83
+ - keep-alive
84
+ body:
85
+ encoding: US-ASCII
86
+ string: ! '{"Request":{"RequestLink":{"ButtonLabel":"Request","ButtonLink":"http://findit.library.jhu.edu/resolve?genre=book","RequestMessage":"Borrow
87
+ Direct cannot fill this request at this time. Please request through Interlibrary
88
+ Loan."}}}'
89
+ http_version:
90
+ recorded_at: Tue, 21 Oct 2014 17:05:44 GMT
91
+ recorded_with: VCR 2.9.3