From 24ef0c9a6e9537843eab4f0219752831b67ad00c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 8 Mar 2018 21:19:51 +0000 Subject: Add endpoint for listing services --- site/search.json | 4 ++++ site/test.cpp | 9 +++++++++ 2 files changed, 13 insertions(+) (limited to 'site') diff --git a/site/search.json b/site/search.json index ca1041d..dd11229 100644 --- a/site/search.json +++ b/site/search.json @@ -4,6 +4,10 @@ "list": { "path": "/list/{filename}", "operation": "MirrorSearch.Search.getMatches" + }, + "services": { + "path": "/services", + "operation": "MirrorSearch.Search.getServices" } }, "slices": [ diff --git a/site/test.cpp b/site/test.cpp index 7fcc2ae..ab71f83 100644 --- a/site/test.cpp +++ b/site/test.cpp @@ -69,6 +69,15 @@ BOOST_AUTO_TEST_CASE( testCallIndexNoFile ) BOOST_CHECK_EQUAL(h["Status"], "404 Not found"); } +BOOST_AUTO_TEST_CASE( testCallServiceList ) +{ + TestRequest requestGetIndex(this, HttpMethod::GET, "/services"); + process(&requestGetIndex); + auto h = requestGetIndex.getResponseHeaders(); + BOOST_CHECK_EQUAL(h["Status"], "200 OK"); + BOOST_CHECK_EQUAL(h["Content-Type"], "application/json"); +} + BOOST_AUTO_TEST_CASE( testCallIndex ) { TestRequest requestGetIndex(this, HttpMethod::GET, "/list/somefile.txt"); -- cgit v1.2.3