Added corpusinfo endpoint
Change-Id: I81a24670e437dad5ac449566eac9460a0819ef18
diff --git a/t/fixtures/fake_backend.pl b/t/fixtures/fake_backend.pl
index a49b05f..89ad3c3 100644
--- a/t/fixtures/fake_backend.pl
+++ b/t/fixtures/fake_backend.pl
@@ -125,6 +125,23 @@
};
+# Statistics endpoint
+get '/statistics' => sub {
+ my $c = shift;
+ my $v = $c->validation;
+ $v->optional('corpusQuery');
+
+ my @list = 'corpusinfo';
+ if ($v->param('corpusQuery')) {
+ push @list, $v->param('corpusQuery');
+ };
+ my $slug = slugify(join('_', @list));
+
+ # Get response based on query parameter
+ my $response = $c->load_response($slug);
+ return $c->render(%$response);
+};
+
############
# Auth API #
############
diff --git a/t/fixtures/response_corpusinfo.json b/t/fixtures/response_corpusinfo.json
new file mode 100644
index 0000000..1918da5
--- /dev/null
+++ b/t/fixtures/response_corpusinfo.json
@@ -0,0 +1,9 @@
+{
+ "status" : 200,
+ "json" : {
+ "documents":11,
+ "tokens":665842,
+ "sentences":25074,
+ "paragraphs":772
+ }
+}
diff --git a/t/fixtures/response_corpusinfo_docsigle-goeaga.json b/t/fixtures/response_corpusinfo_docsigle-goeaga.json
new file mode 100644
index 0000000..9a65412
--- /dev/null
+++ b/t/fixtures/response_corpusinfo_docsigle-goeaga.json
@@ -0,0 +1,9 @@
+{
+ "status" : 200,
+ "json" : {
+ "documents":5,
+ "tokens":108557,
+ "sentences":3835,
+ "paragraphs":124
+ }
+}