|
Lines 37-43
$schema->storage->txn_begin;
Link Here
|
| 37 |
|
37 |
|
| 38 |
subtest '_read_configuration() tests' => sub { |
38 |
subtest '_read_configuration() tests' => sub { |
| 39 |
|
39 |
|
| 40 |
plan tests => 10; |
40 |
plan tests => 13; |
| 41 |
|
41 |
|
| 42 |
my $configuration; |
42 |
my $configuration; |
| 43 |
t::lib::Mocks::mock_config( 'elasticsearch', undef ); |
43 |
t::lib::Mocks::mock_config( 'elasticsearch', undef ); |
|
Lines 93-99
subtest '_read_configuration() tests' => sub {
Link Here
|
| 93 |
|
93 |
|
| 94 |
$configuration = Koha::SearchEngine::Elasticsearch::_read_configuration; |
94 |
$configuration = Koha::SearchEngine::Elasticsearch::_read_configuration; |
| 95 |
is( $configuration->{index_name}, 'index', 'Index configuration parsed correctly' ); |
95 |
is( $configuration->{index_name}, 'index', 'Index configuration parsed correctly' ); |
|
|
96 |
is( $configuration->{cxn_pool}, 'Static', 'cxn_pool configuration set correctly to Static if not specified' ); |
| 96 |
is_deeply( $configuration->{nodes}, \@servers , 'Server configuration parsed correctly' ); |
97 |
is_deeply( $configuration->{nodes}, \@servers , 'Server configuration parsed correctly' ); |
|
|
98 |
|
| 99 |
t::lib::Mocks::mock_config( 'elasticsearch', { server => \@servers, index_name => 'index', cxn_pool => 'Fluid' } ); |
| 100 |
|
| 101 |
$configuration = Koha::SearchEngine::Elasticsearch::_read_configuration; |
| 102 |
is( $configuration->{cxn_pool}, 'Fluid', 'cxn_pool configuration parsed correctly' ); |
| 103 |
|
| 104 |
my $params = Koha::SearchEngine::Elasticsearch::get_elasticsearch_params; |
| 105 |
is_deeply( $configuration->{nodes}, \@servers , 'get_elasticsearch_params is just a wrapper for _read_configuration' ); |
| 106 |
|
| 97 |
}; |
107 |
}; |
| 98 |
|
108 |
|
| 99 |
subtest 'get_elasticsearch_settings() tests' => sub { |
109 |
subtest 'get_elasticsearch_settings() tests' => sub { |
| 100 |
- |
|
|