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

(-)a/t/db_dependent/api/v1/erm_counter_registries.t (+6 lines)
Lines 34-47 use Koha::Database; Link Here
34
# The Usage statistics module uses an external API to fetch data from the counter registry
34
# The Usage statistics module uses an external API to fetch data from the counter registry
35
# This test is designed to catch any changes in the response that the API provides so that we can react quickly to ensure the module still functions as expected
35
# This test is designed to catch any changes in the response that the API provides so that we can react quickly to ensure the module still functions as expected
36
36
37
my $schema  = Koha::Database->new->schema;
37
my $builder = t::lib::TestBuilder->new;
38
my $builder = t::lib::TestBuilder->new;
38
39
39
my $t = Test::Mojo->new('Koha::REST::V1');
40
my $t = Test::Mojo->new('Koha::REST::V1');
40
t::lib::Mocks::mock_preference( 'RESTBasicAuth', 1 );
41
t::lib::Mocks::mock_preference( 'RESTBasicAuth', 1 );
41
42
42
subtest 'get() tests' => sub {
43
subtest 'get() tests' => sub {
44
43
    plan tests => 5;
45
    plan tests => 5;
44
46
47
    $schema->storage->txn_begin;
48
45
    my @expected_fields = (
49
    my @expected_fields = (
46
        "abbrev",
50
        "abbrev",
47
        "address",
51
        "address",
Lines 90-93 subtest 'get() tests' => sub { Link Here
90
    my @new_fields_in_response = array_minus( @response_fields, @expected_fields );
94
    my @new_fields_in_response = array_minus( @response_fields, @expected_fields );
91
95
92
    is( scalar(@new_fields_in_response), 0, 'The response fields match the expected fields' );
96
    is( scalar(@new_fields_in_response), 0, 'The response fields match the expected fields' );
97
98
    $schema->storage->txn_rollback;
93
};
99
};
(-)a/t/db_dependent/api/v1/erm_sushi_services.t (-1 / +6 lines)
Lines 31-36 use Array::Utils qw( array_minus ); Link Here
31
use Koha::ERM::EUsage::CounterFiles;
31
use Koha::ERM::EUsage::CounterFiles;
32
use Koha::Database;
32
use Koha::Database;
33
33
34
my $schema  = Koha::Database->new->schema;
34
my $builder = t::lib::TestBuilder->new;
35
my $builder = t::lib::TestBuilder->new;
35
36
36
my $t = Test::Mojo->new('Koha::REST::V1');
37
my $t = Test::Mojo->new('Koha::REST::V1');
Lines 40-47 t::lib::Mocks::mock_preference( 'RESTBasicAuth', 1 ); Link Here
40
# This test is designed to catch any changes in the response that the API provides so that we can react quickly to ensure the module still functions as expected
41
# This test is designed to catch any changes in the response that the API provides so that we can react quickly to ensure the module still functions as expected
41
42
42
subtest 'get() tests' => sub {
43
subtest 'get() tests' => sub {
44
43
    plan tests => 5;
45
    plan tests => 5;
44
46
47
    $schema->storage->txn_begin;
48
45
    my $service_url = "https://registry.countermetrics.org/api/v1/sushi-service/b94bc981-fa16-4bf6-ba5f-6c113f7ffa0b/";
49
    my $service_url = "https://registry.countermetrics.org/api/v1/sushi-service/b94bc981-fa16-4bf6-ba5f-6c113f7ffa0b/";
46
    my @expected_fields = (
50
    my @expected_fields = (
47
        "api_key_info",
51
        "api_key_info",
Lines 100-103 subtest 'get() tests' => sub { Link Here
100
    my @new_fields_in_response = array_minus( @response_fields, @expected_fields );
104
    my @new_fields_in_response = array_minus( @response_fields, @expected_fields );
101
105
102
    is( scalar(@new_fields_in_response), 0, 'The response fields match the expected fields' );
106
    is( scalar(@new_fields_in_response), 0, 'The response fields match the expected fields' );
107
108
    $schema->storage->txn_rollback;
103
};
109
};
104
- 

Return to bug 37898