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

(-)a/Koha/BackgroundJob.pm (-2 / +3 lines)
Lines 67-74 sub connect { Link Here
67
    return undef
67
    return undef
68
        unless $notification_method eq 'STOMP';
68
        unless $notification_method eq 'STOMP';
69
69
70
    my $hostname = 'localhost';
70
    my $hostname = $ENV{KOHA_STOMP_HOSTNAME} // 'localhost';
71
    my $port = '61613';
71
    my $port     = $ENV{KOHA_STOMP_PORT}     // '61613';
72
72
    my $config = C4::Context->config('message_broker');
73
    my $config = C4::Context->config('message_broker');
73
    my $credentials = {
74
    my $credentials = {
74
        login => 'guest',
75
        login => 'guest',
(-)a/t/db_dependent/Koha/BackgroundJob.t (-2 / +16 lines)
Lines 19-25 use Modern::Perl; Link Here
19
use utf8;
19
use utf8;
20
use Encode;
20
use Encode;
21
21
22
use Test::More tests => 5;
22
use Test::More tests => 6;
23
use Test::MockModule;
23
use Test::MockModule;
24
use Test::Exception;
24
use Test::Exception;
25
25
Lines 297-299 subtest 'decoded_data() and set_encoded_data() tests' => sub { Link Here
297
297
298
    $schema->storage->txn_rollback;
298
    $schema->storage->txn_rollback;
299
};
299
};
300
- 
300
301
subtest 'decoded_data() and set_encoded_data() tests' => sub {
302
    plan tests => 2;
303
304
    $ENV{KOHA_STOMP_HOSTNAME} = "not_localhost";
305
    $ENV{KOHA_STOMP_PORT} = "99999";
306
307
    t::lib::Mocks::mock_preference('JobsNotificationMethod', 'STOMP');
308
    my $job = Koha::BackgroundJob->connect();
309
    is( $job, undef, "Return undef if unable to connect when using stomp" );
310
311
    t::lib::Mocks::mock_preference('JobsNotificationMethod', 'polling');
312
    $job = Koha::BackgroundJob->connect();
313
    is( $job, undef, "Return undef if using polling" );
314
}

Return to bug 35655