8#include <boost/test/unit_test.hpp>
17 uri =
"localhost:8080/rest/headers/someresource.json";
21 uri =
"localhost:8080/rest/endpoint/someresource.json?p1=v1";
26 uri =
"/rest/endpoint/someresource.json?p1=v1&p2=v2";
31 uri =
"/rest/endpoint/someresource.json?p1=v1&p1=v2";
35 uri =
"/rest/endpoint/someresource.json&p1=v1&p2=v2";
39 uri =
"/rest/endpoint/someresource.json&p1=v1&p2=v2%";
40 BOOST_CHECK_EXCEPTION(
GetQueryParameterFromUri(uri.c_str(),
"p1"), std::runtime_error,
HasReason(
"URI parsing failed, it likely contained RFC 3986 invalid characters"));
BOOST_CHECK_EXCEPTION predicates to check the specific validation error.
BOOST_FIXTURE_TEST_SUITE(cuckoocache_tests, BasicTestingSetup)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
std::optional< std::string > GetQueryParameterFromUri(const char *uri, const std::string &key)
Get the query parameter value from request uri for a specified key, or std::nullopt if the key is not...
BOOST_AUTO_TEST_CASE(test_query_parameters)
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)