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