| my $mount_point = '/realapi/'; |
| $ENV{KALAMAR_API} = $mount_point; |
| my $t = Test::Mojo->new('Kalamar'); |
| my $fixtures_path = path(Mojo::File->new(__FILE__)->dirname, 'server'); |
| my $fake_backend = $t->app->plugin( |
| $fixtures_path->child('mock.pl') |
| $fake_backend->pattern->defaults->{app}->log($t->app->log); |
| $t->get_ok('/corpus/GOE/AGI/00000') |
| ->json_is('/document/fields/0/key', 'textSigle') |
| ->json_is('/document/fields/0/value', 'GOE/AGI/00000') |
| # Not found - should probably be 404 |
| $t->get_ok('/corpus/GOE/AGY/00000') |
| ->json_is('/notifications/0/1', '630: Document not found') |