@@ -, +, @@ --- t/db_dependent/OAI/Server.t | 42 ++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) --- a/t/db_dependent/OAI/Server.t +++ a/t/db_dependent/OAI/Server.t @@ -21,7 +21,7 @@ use Modern::Perl; use Test::Deep qw( cmp_deeply re ); use Test::MockTime qw/set_fixed_time set_relative_time restore_time/; -use Test::More tests => 33; +use Test::More tests => 34; use DateTime; use File::Basename; use File::Spec; @@ -865,3 +865,43 @@ subtest 'Tests for timestamp handling' => sub { $schema->storage->txn_rollback; }; + +subtest 'ListSets() tests' => sub { + + plan tests => 2; + + $schema->storage->txn_begin; + + # initial cleanup + $schema->resultset('OaiSet')->delete; + + test_query( + 'ListSets - no sets should return a noSetHierarchy exception', + { verb => 'ListSets' }, + { + error => { + code => 'noSetHierarchy', + content => 'There are no OAI sets defined', + } + } + ); + + # Add a couple sets + AddOAISet({ spec => 'set_1', name => 'Set 1' }); + AddOAISet({ spec => 'set_2', name => 'Set 2' }); + + test_query( + 'ListSets - no sets should return a noSetHierarchy exception', + { verb => 'ListSets' }, + { + ListSets => { + set => [ + { setSpec => 'set_1', setName => 'Set 1' }, + { setSpec => 'set_2', setName => 'Set 2' }, + ] + } + } + ); + + $schema->storage->txn_rollback; +}; --