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
@@ -0,0 +1,77 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://rc.relais-host.com/portal-service/user/authentication
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"ApiKey":"DUMMY_BD_API_KEY","PartnershipId":"BD","UserGroup":"patron","LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","PatronId":"DUMMY_BD_PATRON"}'
9
+ headers:
10
+ User-Agent:
11
+ - ruby borrow_direct gem 1.2.0 (HTTPClient 2.6.0.1) https://github.com/jrochkind/borrow_direct
12
+ Accept:
13
+ - "*/*"
14
+ Date:
15
+ - Thu, 15 Oct 2015 15:15:59 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
+ - Thu, 15 Oct 2015 15:16:00 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":"zFjAgRX2ybaUYi-GwA5lRdNaAZM","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:16:00 GMT
40
+ - request:
41
+ method: post
42
+ uri: https://rc.relais-host.com/dws/item/available?aid=bad_aid
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:16:00 GMT
53
+ Content-Type:
54
+ - application/json
55
+ Accept-Language:
56
+ - en
57
+ response:
58
+ status:
59
+ code: 401
60
+ message: Unauthorized
61
+ headers:
62
+ Server:
63
+ - nginx/1.4.1
64
+ Date:
65
+ - Thu, 15 Oct 2015 15:16:01 GMT
66
+ Content-Type:
67
+ - application/json;charset=UTF-8
68
+ Transfer-Encoding:
69
+ - chunked
70
+ Connection:
71
+ - keep-alive
72
+ body:
73
+ encoding: UTF-8
74
+ string: '{"Problem":{"ErrorCode":"PUBFI003","ErrorMessage":"Invalid aid"}}'
75
+ http_version:
76
+ recorded_at: Thu, 15 Oct 2015 15:16:01 GMT
77
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://rc.relais-host.com/portal-service/user/authentication
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"ApiKey":"DUMMY_BD_API_KEY","PartnershipId":"BD","UserGroup":"patron","LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","PatronId":"DUMMY_BD_PATRON"}'
9
+ headers:
10
+ User-Agent:
11
+ - ruby borrow_direct gem 1.2.0 (HTTPClient 2.6.0.1) https://github.com/jrochkind/borrow_direct
12
+ Accept:
13
+ - "*/*"
14
+ Date:
15
+ - Thu, 15 Oct 2015 15:15:50 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
+ - Thu, 15 Oct 2015 15:15:51 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":"ZhgS3lhFsXirWB7uDSV-NNRDBB0","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:51 GMT
40
+ recorded_with: VCR 2.9.3
@@ -2,17 +2,54 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://bdtest.relais-host.com/no/such/path
5
+ uri: https://rc.relais-host.com/portal-service/user/authentication
6
6
  body:
7
7
  encoding: UTF-8
8
- string: ! '{"foo":"bar"}'
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:01 GMT
15
+ - Thu, 15 Oct 2015 15:15:56 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
+ - Thu, 15 Oct 2015 15:15:57 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":"wqJABGsbRZrhfCy1h92c8NkCV5U","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:57 GMT
40
+ - request:
41
+ method: post
42
+ uri: https://rc.relais-host.com/no/such/path
43
+ body:
44
+ encoding: UTF-8
45
+ string: '{"foo":"bar"}'
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:57 GMT
16
53
  Content-Type:
17
54
  - application/json
18
55
  Accept-Language:
@@ -25,29 +62,29 @@ http_interactions:
25
62
  Server:
26
63
  - nginx/1.4.1
27
64
  Date:
28
- - Tue, 21 Oct 2014 17:06:01 GMT
65
+ - Thu, 15 Oct 2015 15:15:57 GMT
29
66
  Content-Type:
30
67
  - text/html; charset=UTF-8
31
- Content-Length:
32
- - '1605'
68
+ Transfer-Encoding:
69
+ - chunked
33
70
  Connection:
34
71
  - keep-alive
35
- Etag:
36
- - ! '"5411bb96-645"'
37
72
  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>"
73
+ encoding: UTF-8
74
+ string: <!DOCTYPE html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible"
75
+ content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1,
76
+ maximum-scale=1, user-scalable=no"><link rel="icon" href="/img/favicon-6.14.47-HOTFIX-RELEASE.ico"
77
+ type="image/x-icon"/><link rel="shortcut icon" href="/img/favicon-6.14.47-HOTFIX-RELEASE.ico"
78
+ type="image/x-icon"/><link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css"/><script
79
+ type="text/javascript" src="/js/head.core.min-v1.0.3.js"></script><script
80
+ type="text/javascript" src="/js/portalAir-6.14.47-HOTFIX-RELEASE.js"></script><script>head.load("/js/portalComponent-6.14.47-HOTFIX-RELEASE.js","/htc/commonCompObj-6.14.47-HOTFIX-RELEASE.js","/err/htc/errorMenuCompObj-6.14.47-HOTFIX-RELEASE.js","/err/htc/error404CompObj-6.14.47-HOTFIX-RELEASE.js","/htc/placeHolderCompObj-6.14.47-HOTFIX-RELEASE.js");head.load("/js/jquery.min-v1.11.1.js","/js/jquery.ui.min-v1.11.0.js","/js/jquery.dataset-v0.1.0.js","/js/underscore-v1.7.0.js","/js/stringjs.min-v2.2.0.js","/js/URI-v1.13.2.js","/js/sessionstorage.js","/js/jquery.timer.js","/js/sanitizeHTMLComponentData-6.14.47-HOTFIX-RELEASE.js","/js/portalService-6.14.47-HOTFIX-RELEASE.js","/js/portalForm-6.14.47-HOTFIX-RELEASE.js","/js/portalUI-Core-6.14.47-HOTFIX-RELEASE.js","/err/htc/errorBLL-6.14.47-HOTFIX-RELEASE.js");</script><!--[if
81
+ lt IE 9]><script type="text/javascript" src="/js/html5Shiv-v3.7.0.js"></script><script
82
+ type="text/javascript" src="/js/respond-v1.4.2.js"></script><![endif]--></head><body><div
83
+ id="divPage"><div id="divTopBanner"><div class="component" id="TopBannerPlaceHolder">&nbsp;
84
+ </div></div><div id="divHeader"><div id="Header">&nbsp; </div></div><div id="divHorizontalMenu"><div
85
+ id="ErrorMenu">&nbsp; </div></div><div id="divContent"><div id="Error404">&nbsp;
86
+ </div></div><div id="divFooter"><div id="Footer">&nbsp; </div></div><div id="divBottomBanner"><div
87
+ class="component" id="BottomBannerPlaceHolder">&nbsp; </div></div></div><script>head.ready(function(){portalError.setUpOp404();diController.processOps(diController.opList);});</script></body></html>
51
88
  http_version:
52
- recorded_at: Tue, 21 Oct 2014 17:06:01 GMT
89
+ recorded_at: Thu, 15 Oct 2015 15:15:57 GMT
53
90
  recorded_with: VCR 2.9.3
@@ -2,17 +2,54 @@
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: ! '{"foo":"bar"}'
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:05:58 GMT
15
+ - Thu, 15 Oct 2015 15:15:48 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
+ - Thu, 15 Oct 2015 15:15:50 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":"uk-Y8A6FNk7z24gAyIQep0a1pWw","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:50 GMT
40
+ - request:
41
+ method: post
42
+ uri: https://rc.relais-host.com/dws/item/available?aid=uk-Y8A6FNk7z24gAyIQep0a1pWw
43
+ body:
44
+ encoding: UTF-8
45
+ string: '{"foo":"bar"}'
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:50 GMT
16
53
  Content-Type:
17
54
  - application/json
18
55
  Accept-Language:
@@ -25,39 +62,17 @@ http_interactions:
25
62
  Server:
26
63
  - nginx/1.4.1
27
64
  Date:
28
- - Tue, 21 Oct 2014 17:05:58 GMT
65
+ - Thu, 15 Oct 2015 15:15:50 GMT
29
66
  Content-Type:
30
- - text/html; charset=ISO-8859-1
31
- Content-Length:
32
- - '306'
67
+ - application/json;charset=UTF-8
68
+ Transfer-Encoding:
69
+ - chunked
33
70
  Connection:
34
71
  - keep-alive
35
- Cache-Control:
36
- - must-revalidate,no-cache,no-store
37
72
  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
- '
73
+ encoding: UTF-8
74
+ string: '{"Problem":{"ErrorCode":"PUBFI001","ErrorMessage":"Required input is
75
+ missing; PartnershipId is required"}}'
61
76
  http_version:
62
- recorded_at: Tue, 21 Oct 2014 17:05:58 GMT
77
+ recorded_at: Thu, 15 Oct 2015 15:15:50 GMT
63
78
  recorded_with: VCR 2.9.3
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://rc.relais-host.com/portal-service/user/authentication
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"ApiKey":"DUMMY_BD_API_KEY","PartnershipId":"BD","UserGroup":"patron","LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","PatronId":"DUMMY_BD_PATRON"}'
9
+ headers:
10
+ User-Agent:
11
+ - ruby borrow_direct gem 1.2.0 (HTTPClient 2.6.0.1) https://github.com/jrochkind/borrow_direct
12
+ Accept:
13
+ - "*/*"
14
+ Date:
15
+ - Thu, 15 Oct 2015 15:15:47 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
+ - Thu, 15 Oct 2015 15:15:48 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":"oXvOoD-IKeFeWNSWPl4mqFYkceM","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:48 GMT
40
+ recorded_with: VCR 2.9.3
@@ -2,17 +2,54 @@
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":"BAD_ID","Credentials":{"LibrarySymbol":"librarySymbol","Barcode":"barcode/patronId"},"ExactSearch":[{"Type":"type","Value":"value"}]}'
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:05:44 GMT
15
+ - Thu, 15 Oct 2015 15:16: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
+ - Thu, 15 Oct 2015 15:16:02 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":"AHxq9iZ4aBZOrZZi52IpdfuzSGI","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:16:02 GMT
40
+ - request:
41
+ method: post
42
+ uri: https://rc.relais-host.com/dws/item/available?aid=AHxq9iZ4aBZOrZZi52IpdfuzSGI
43
+ body:
44
+ encoding: UTF-8
45
+ string: '{"PartnershipId":"BD","ExactSearch":[{"Type":"BADBAD","Value":"2292389283928392382938"}]}'
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:16:02 GMT
16
53
  Content-Type:
17
54
  - application/json
18
55
  Accept-Language:
@@ -25,7 +62,7 @@ http_interactions:
25
62
  Server:
26
63
  - nginx/1.4.1
27
64
  Date:
28
- - Tue, 21 Oct 2014 17:05:45 GMT
65
+ - Thu, 15 Oct 2015 15:16:02 GMT
29
66
  Content-Type:
30
67
  - application/json;charset=UTF-8
31
68
  Transfer-Encoding:
@@ -33,9 +70,9 @@ http_interactions:
33
70
  Connection:
34
71
  - keep-alive
35
72
  body:
36
- encoding: US-ASCII
37
- string: ! '{"Error":{"ErrorNumber":"PUBFI003","ErrorMessage":"Invalid PartnershipId:
38
- BAD_ID"}}'
73
+ encoding: UTF-8
74
+ string: '{"Problem":{"ErrorCode":"PRIFI001","ErrorMessage":"Internal error occurred
75
+ in FindItem"}}'
39
76
  http_version:
40
- recorded_at: Tue, 21 Oct 2014 17:05:45 GMT
77
+ recorded_at: Thu, 15 Oct 2015 15:16:02 GMT
41
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/portal-service/user/authentication/patron
5
+ uri: https://rc.relais-host.com/portal-service/user/authentication
6
6
  body:
7
7
  encoding: UTF-8
8
- string: ! '{"AuthenticationInformation":{"LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","PatronId":"DUMMY_BD_PATRON"}}'
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:05:27 GMT
15
+ - Thu, 15 Oct 2015 15:16:27 GMT
16
16
  Content-Type:
17
17
  - application/json
18
18
  Accept-Language:
@@ -25,43 +25,31 @@ http_interactions:
25
25
  Server:
26
26
  - nginx/1.4.1
27
27
  Date:
28
- - Tue, 21 Oct 2014 17:05:28 GMT
28
+ - Thu, 15 Oct 2015 15:16:28 GMT
29
29
  Content-Type:
30
30
  - application/json;charset=UTF-8
31
- Transfer-Encoding:
32
- - chunked
31
+ Content-Length:
32
+ - '269'
33
33
  Connection:
34
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
35
  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"}}}}}'
36
+ encoding: UTF-8
37
+ string: '{"AuthorizationId":"WUsMNRzW20qWYrzg3_JvV6zdABU","LibrarySymbol":"DUMMY_BD_LIBRARY_SYMBOL","Iso639_2_LangCode":"ENG","FirstName":"Jonathan","LastName":"Rochkind","AllowLoanAddRequest":true,"AllowCopyAddRequest":false,"AllowSelDelivLoanChange":true,"AllowSelDelivCopyChange":false}'
50
38
  http_version:
51
- recorded_at: Tue, 21 Oct 2014 17:05:28 GMT
39
+ recorded_at: Thu, 15 Oct 2015 15:16:28 GMT
52
40
  - request:
53
41
  method: post
54
- uri: https://bdtest.relais-host.com/dws/item/add
42
+ uri: https://rc.relais-host.com/dws/item/add?aid=WUsMNRzW20qWYrzg3_JvV6zdABU
55
43
  body:
56
44
  encoding: UTF-8
57
- string: ! '{"PartnershipId":"BD","AuthorizationId":"WFWwKG5vIgL2fVNsZJg_tHwRe9w","PickupLocation":null,"ExactSearch":[{"Type":"ISBN","Value":"0745649890"}]}'
45
+ string: '{"PartnershipId":"BD","ExactSearch":[{"Type":"ISBN","Value":"0745649890"}]}'
58
46
  headers:
59
47
  User-Agent:
60
- - ruby borrow_direct gem 0.0.1 (HTTPClient 2.5.1) https://github.com/jrochkind/borrow_direct
48
+ - ruby borrow_direct gem 1.2.0 (HTTPClient 2.6.0.1) https://github.com/jrochkind/borrow_direct
61
49
  Accept:
62
- - ! '*/*'
50
+ - "*/*"
63
51
  Date:
64
- - Tue, 21 Oct 2014 17:05:28 GMT
52
+ - Thu, 15 Oct 2015 15:16:28 GMT
65
53
  Content-Type:
66
54
  - application/json
67
55
  Accept-Language:
@@ -74,7 +62,7 @@ http_interactions:
74
62
  Server:
75
63
  - nginx/1.4.1
76
64
  Date:
77
- - Tue, 21 Oct 2014 17:05:31 GMT
65
+ - Thu, 15 Oct 2015 15:16:34 GMT
78
66
  Content-Type:
79
67
  - application/json;charset=UTF-8
80
68
  Transfer-Encoding:
@@ -82,9 +70,9 @@ http_interactions:
82
70
  Connection:
83
71
  - keep-alive
84
72
  body:
85
- encoding: US-ASCII
86
- string: ! '{"Request":{"RequestLink":{"RequestMessage":"This item is available
87
- locally"}}}'
73
+ encoding: UTF-8
74
+ string: '{"RequestLink":{"ButtonLabel":"Find item","ButtonLink":"https://blacklight.library.jhu.edu/catalyst_demo/catalog/bib_4733731","RequestMessage":"This
75
+ item is available locally."}}'
88
76
  http_version:
89
- recorded_at: Tue, 21 Oct 2014 17:05:31 GMT
77
+ recorded_at: Thu, 15 Oct 2015 15:16:34 GMT
90
78
  recorded_with: VCR 2.9.3