|
Lines 40-136
subtest 'get() tests' => sub {
Link Here
|
| 40 |
|
40 |
|
| 41 |
my $expected_response = [ |
41 |
my $expected_response = [ |
| 42 |
{ |
42 |
{ |
| 43 |
"abbrev" => "EBSCO", |
43 |
"abbrev" => "EBSCO", |
| 44 |
"address" => "EBSCO Information Services\n10 Estes Street\nIpswich, MA 01938", |
44 |
"address" => "EBSCO Information Services\n10 Estes Street\nIpswich, MA 01938", |
| 45 |
"address_country" => { |
45 |
"address_country" => { |
| 46 |
"code" => "US", |
46 |
"code" => "US", |
| 47 |
"name" => "United States of America" |
47 |
"name" => "United States of America" |
| 48 |
}, |
48 |
}, |
| 49 |
"contact" => { |
49 |
"contact" => { |
| 50 |
"email" => 'chadmovalli@ebsco.com', |
50 |
"email" => 'chadmovalli@ebsco.com', |
| 51 |
"form_url" => "", |
51 |
"form_url" => "", |
| 52 |
"person" => "Chad Movalli", |
52 |
"person" => "Chad Movalli", |
| 53 |
"phone" => "" |
53 |
"phone" => "" |
| 54 |
}, |
54 |
}, |
| 55 |
"content_provider_name" => "EBSCO", |
55 |
"content_provider_name" => "EBSCO", |
| 56 |
"host_types" => [ |
56 |
"host_types" => [ { "name" => "Aggregated_Full_Content" } ], |
| 57 |
{ |
57 |
"id" => "b2b2736c-2cb9-48ec-91f4-870336acfb1c", |
| 58 |
"name" => "Aggregated_Full_Content" |
58 |
"name" => "EBSCO Information Services", |
| 59 |
} |
59 |
"reports" => [ |
| 60 |
], |
|
|
| 61 |
"id" => "b2b2736c-2cb9-48ec-91f4-870336acfb1c", |
| 62 |
"name" => "EBSCO Information Services", |
| 63 |
"reports" => [ |
| 64 |
{ |
60 |
{ |
| 65 |
"counter_release" => "5", |
61 |
"counter_release" => "5", |
| 66 |
"report_id" => "TR_J4", |
62 |
"report_id" => "TR_J4", |
| 67 |
"report_name" => "Title Report - Journal Report 4" |
63 |
"report_name" => "Title Report - Journal Report 4" |
| 68 |
}, |
64 |
}, |
| 69 |
{ |
65 |
{ |
| 70 |
"counter_release" => "5", |
66 |
"counter_release" => "5", |
| 71 |
"report_id" => "DR_D2", |
67 |
"report_id" => "DR_D2", |
| 72 |
"report_name" => "Database Report - Report 2" |
68 |
"report_name" => "Database Report - Report 2" |
| 73 |
}, |
69 |
}, |
| 74 |
{ |
70 |
{ |
| 75 |
"counter_release" => "5", |
71 |
"counter_release" => "5", |
| 76 |
"report_id" => "TR_J3", |
72 |
"report_id" => "TR_J3", |
| 77 |
"report_name" => "Title Report - Journal Report 3" |
73 |
"report_name" => "Title Report - Journal Report 3" |
| 78 |
}, |
74 |
}, |
| 79 |
{ |
75 |
{ |
| 80 |
"counter_release" => "5", |
76 |
"counter_release" => "5", |
| 81 |
"report_id" => "DR_D1", |
77 |
"report_id" => "DR_D1", |
| 82 |
"report_name" => "Database Report - Report 1" |
78 |
"report_name" => "Database Report - Report 1" |
| 83 |
}, |
79 |
}, |
| 84 |
{ |
80 |
{ |
| 85 |
"counter_release" => "5", |
81 |
"counter_release" => "5", |
| 86 |
"report_id" => "TR_J2", |
82 |
"report_id" => "TR_J2", |
| 87 |
"report_name" => "Title Report - Journal Report 2" |
83 |
"report_name" => "Title Report - Journal Report 2" |
| 88 |
}, |
84 |
}, |
| 89 |
{ |
85 |
{ |
| 90 |
"counter_release" => "5", |
86 |
"counter_release" => "5", |
| 91 |
"report_id" => "PR", |
87 |
"report_id" => "PR", |
| 92 |
"report_name" => "Platform Master Report" |
88 |
"report_name" => "Platform Master Report" |
| 93 |
}, |
89 |
}, |
| 94 |
{ |
90 |
{ |
| 95 |
"counter_release" => "5", |
91 |
"counter_release" => "5", |
| 96 |
"report_id" => "TR_B2", |
92 |
"report_id" => "TR_B2", |
| 97 |
"report_name" => "Title Report - Book Report 2" |
93 |
"report_name" => "Title Report - Book Report 2" |
| 98 |
}, |
94 |
}, |
| 99 |
{ |
95 |
{ |
| 100 |
"counter_release" => "5", |
96 |
"counter_release" => "5", |
| 101 |
"report_id" => "TR_B3", |
97 |
"report_id" => "TR_B3", |
| 102 |
"report_name" => "Title Report - Book Report 3" |
98 |
"report_name" => "Title Report - Book Report 3" |
| 103 |
}, |
99 |
}, |
| 104 |
{ |
100 |
{ |
| 105 |
"counter_release" => "5", |
101 |
"counter_release" => "5", |
| 106 |
"report_id" => "TR", |
102 |
"report_id" => "TR", |
| 107 |
"report_name" => "Title Master Report" |
103 |
"report_name" => "Title Master Report" |
| 108 |
}, |
104 |
}, |
| 109 |
{ |
105 |
{ |
| 110 |
"counter_release" => "5", |
106 |
"counter_release" => "5", |
| 111 |
"report_id" => "TR_B1", |
107 |
"report_id" => "TR_B1", |
| 112 |
"report_name" => "Title Report - Book Report 1" |
108 |
"report_name" => "Title Report - Book Report 1" |
| 113 |
}, |
109 |
}, |
| 114 |
{ |
110 |
{ |
| 115 |
"counter_release" => "5", |
111 |
"counter_release" => "5", |
| 116 |
"report_id" => "PR_P1", |
112 |
"report_id" => "PR_P1", |
| 117 |
"report_name" => "Platform Report - Report 1" |
113 |
"report_name" => "Platform Report - Report 1" |
| 118 |
}, |
114 |
}, |
| 119 |
{ |
115 |
{ |
| 120 |
"counter_release" => "5", |
116 |
"counter_release" => "5", |
| 121 |
"report_id" => "TR_J1", |
117 |
"report_id" => "TR_J1", |
| 122 |
"report_name" => "Title Report - Journal Report 1" |
118 |
"report_name" => "Title Report - Journal Report 1" |
| 123 |
}, |
119 |
}, |
| 124 |
{ |
120 |
{ |
| 125 |
"counter_release" => "5", |
121 |
"counter_release" => "5", |
| 126 |
"report_id" => "DR", |
122 |
"report_id" => "DR", |
| 127 |
"report_name" => "Database Master Report" |
123 |
"report_name" => "Database Master Report" |
| 128 |
} |
124 |
} |
| 129 |
], |
125 |
], |
| 130 |
"sushi_services" => [ |
126 |
"sushi_services" => [ |
| 131 |
{ |
127 |
{ |
| 132 |
"counter_release" => "5", |
128 |
"counter_release" => "5", |
| 133 |
"url" => "https:\/\/registry.projectcounter.org\/api\/v1\/sushi-service\/b94bc981-fa16-4bf6-ba5f-6c113f7ffa0b\/" |
129 |
"url" => |
|
|
130 |
"https:\/\/registry.projectcounter.org\/api\/v1\/sushi-service\/b94bc981-fa16-4bf6-ba5f-6c113f7ffa0b\/" |
| 134 |
} |
131 |
} |
| 135 |
], |
132 |
], |
| 136 |
"website" => "https:\/\/www.ebsco.com\/" |
133 |
"website" => "https:\/\/www.ebsco.com\/" |
|
Lines 161-167
subtest 'get() tests' => sub {
Link Here
|
| 161 |
$t->get_ok("//$unauth_userid:$password@/api/v1/erm/counter_registry")->status_is(403); |
158 |
$t->get_ok("//$unauth_userid:$password@/api/v1/erm/counter_registry")->status_is(403); |
| 162 |
|
159 |
|
| 163 |
# Authorised access test |
160 |
# Authorised access test |
| 164 |
my $q = encode_json( { "name" => "EBSCO Information Services" } ); |
161 |
my $q = encode_json( { "name" => "EBSCO Information Services" } ); |
| 165 |
my $counter_registry = $t->get_ok("//$userid:$password@/api/v1/erm/counter_registry?q=$q")->status_is(200)->tx->res->json; |
162 |
my $counter_registry = |
|
|
163 |
$t->get_ok("//$userid:$password@/api/v1/erm/counter_registry?q=$q")->status_is(200)->tx->res->json; |
| 166 |
is_deeply( $counter_registry, $expected_response ); |
164 |
is_deeply( $counter_registry, $expected_response ); |
| 167 |
}; |
165 |
}; |