View | Details | Raw Unified | Return to bug 35218
Collapse All | Expand All

(-)a/t/db_dependent/api/v1/erm_counter_registries.t (-42 / +40 lines)
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
};
(-)a/t/db_dependent/api/v1/erm_sushi_services.t (-34 / +31 lines)
Lines 40-72 subtest 'get() tests' => sub { Link Here
40
40
41
    my $service_url = "https://registry.projectcounter.org/api/v1/sushi-service/b94bc981-fa16-4bf6-ba5f-6c113f7ffa0b/";
41
    my $service_url = "https://registry.projectcounter.org/api/v1/sushi-service/b94bc981-fa16-4bf6-ba5f-6c113f7ffa0b/";
42
    my $expected_response = {
42
    my $expected_response = {
43
        "api_key_info"=> "",
43
        "api_key_info"     => "",
44
        "api_key_required"=> 0,
44
        "api_key_required" => 0,
45
        "contact"=> {
45
        "contact"          => {
46
            "email"=> 'chadmovalli@ebsco.com',
46
            "email"    => 'chadmovalli@ebsco.com',
47
            "form_url"=> "",
47
            "form_url" => "",
48
            "person"=> "Chad Movalli",
48
            "person"   => "Chad Movalli",
49
            "phone"=> ""
49
            "phone"    => ""
50
        },
50
        },
51
        "counter_release"=> "5",
51
        "counter_release"              => "5",
52
        "credentials_auto_expire"=> 0,
52
        "credentials_auto_expire"      => 0,
53
        "credentials_auto_expire_info"=> "",
53
        "credentials_auto_expire_info" => "",
54
        "customer_id_info"=> "This is your EBSCOhost Customer ID",
54
        "customer_id_info"             => "This is your EBSCOhost Customer ID",
55
        "customizations_in_place"=> 0,
55
        "customizations_in_place"      => 0,
56
        "customizations_info"=> "",
56
        "customizations_info"          => "",
57
        "data_host"=> "https:\/\/registry.projectcounter.org\/api\/v1\/usage-data-host\/72a35413-6fcd-44f2-8bce-0c7b2373e33f\/",
57
        "data_host"                    =>
58
        "id"=> "b94bc981-fa16-4bf6-ba5f-6c113f7ffa0b",
58
            "https:\/\/registry.projectcounter.org\/api\/v1\/usage-data-host\/72a35413-6fcd-44f2-8bce-0c7b2373e33f\/",
59
        "ip_address_authorization"=> 0,
59
        "id"                            => "b94bc981-fa16-4bf6-ba5f-6c113f7ffa0b",
60
        "ip_address_authorization_info"=> "",
60
        "ip_address_authorization"      => 0,
61
        "notification_count"=> 1,
61
        "ip_address_authorization_info" => "",
62
        "notifications_url"=> "https:\/\/registry.projectcounter.org\/api\/v1\/sushi-service\/b94bc981-fa16-4bf6-ba5f-6c113f7ffa0b\/notification\/",
62
        "notification_count"            => 1,
63
        "platform_attr_required"=> 0,
63
        "notifications_url"             =>
64
        "platform_specific_info"=> "",
64
            "https:\/\/registry.projectcounter.org\/api\/v1\/sushi-service\/b94bc981-fa16-4bf6-ba5f-6c113f7ffa0b\/notification\/",
65
        "request_volume_limits_applied"=> 0,
65
        "platform_attr_required"        => 0,
66
        "request_volume_limits_info"=> "",
66
        "platform_specific_info"        => "",
67
        "requestor_id_info"=> "Customers generate their Requestor ID in EBSCOAdmin on the SUSHI Authentication tab within the COUNTER R5 Reports section.",
67
        "request_volume_limits_applied" => 0,
68
        "requestor_id_required"=> 1,
68
        "request_volume_limits_info"    => "",
69
        "url"=> "https:\/\/sushi.ebscohost.com\/R5"
69
        "requestor_id_info"             =>
70
            "Customers generate their Requestor ID in EBSCOAdmin on the SUSHI Authentication tab within the COUNTER R5 Reports section.",
71
        "requestor_id_required" => 1,
72
        "url"                   => "https:\/\/sushi.ebscohost.com\/R5"
70
    };
73
    };
71
74
72
    my $librarian = $builder->build_object(
75
    my $librarian = $builder->build_object(
Lines 93-104 subtest 'get() tests' => sub { Link Here
93
    $t->get_ok("//$unauth_userid:$password@/api/v1/erm/sushi_service")->status_is(403);
96
    $t->get_ok("//$unauth_userid:$password@/api/v1/erm/sushi_service")->status_is(403);
94
97
95
    # Authorised access test
98
    # Authorised access test
96
    my $q = encode_json(
99
    my $q             = encode_json( { "url" => $service_url } );
97
        {
100
    my $sushi_service = $t->get_ok("//$userid:$password@/api/v1/erm/sushi_service?q=$q")->status_is(200)->tx->res->json;
98
            "url" => $service_url
99
        }
100
    );
101
    my $sushi_service = $t->get_ok("//$userid:$password@/api/v1/erm/sushi_service?q=$q")->status_is(200)
102
        ->tx->res->json;
103
    is_deeply( $sushi_service, $expected_response );
101
    is_deeply( $sushi_service, $expected_response );
104
};
102
};
105
- 

Return to bug 35218