|
Lines 33-39
use Koha::SearchEngine::Elasticsearch::Search;
Link Here
|
| 33 |
|
33 |
|
| 34 |
subtest '_read_configuration() tests' => sub { |
34 |
subtest '_read_configuration() tests' => sub { |
| 35 |
|
35 |
|
| 36 |
plan tests => 13; |
36 |
plan tests => 15; |
| 37 |
|
37 |
|
| 38 |
my $configuration; |
38 |
my $configuration; |
| 39 |
t::lib::Mocks::mock_config( 'elasticsearch', undef ); |
39 |
t::lib::Mocks::mock_config( 'elasticsearch', undef ); |
|
Lines 96-105
subtest '_read_configuration() tests' => sub {
Link Here
|
| 96 |
|
96 |
|
| 97 |
$configuration = Koha::SearchEngine::Elasticsearch::_read_configuration; |
97 |
$configuration = Koha::SearchEngine::Elasticsearch::_read_configuration; |
| 98 |
is( $configuration->{cxn_pool}, 'Fluid', 'cxn_pool configuration parsed correctly' ); |
98 |
is( $configuration->{cxn_pool}, 'Fluid', 'cxn_pool configuration parsed correctly' ); |
|
|
99 |
isnt( defined $configuration->{trace_to}, 'trace_to is not defined if not set' ); |
| 99 |
|
100 |
|
| 100 |
my $params = Koha::SearchEngine::Elasticsearch::get_elasticsearch_params; |
101 |
my $params = Koha::SearchEngine::Elasticsearch::get_elasticsearch_params; |
| 101 |
is_deeply( $configuration->{nodes}, \@servers , 'get_elasticsearch_params is just a wrapper for _read_configuration' ); |
102 |
is_deeply( $configuration->{nodes}, \@servers , 'get_elasticsearch_params is just a wrapper for _read_configuration' ); |
| 102 |
|
103 |
|
|
|
104 |
t::lib::Mocks::mock_config( 'elasticsearch', { server => \@servers, index_name => 'index', cxn_pool => 'Fluid', trace_to => 'Stderr' } ); |
| 105 |
|
| 106 |
$configuration = Koha::SearchEngine::Elasticsearch::_read_configuration; |
| 107 |
is( $configuration->{trace_to}, 'Stderr', 'trace_to configuration parsed correctly' ); |
| 103 |
}; |
108 |
}; |
| 104 |
|
109 |
|
| 105 |
subtest 'get_elasticsearch_settings() tests' => sub { |
110 |
subtest 'get_elasticsearch_settings() tests' => sub { |
| 106 |
- |
|
|