@@ -62,7 +62,7 @@ auto read_file(std::filesystem::path const &path) -> std::string {
|
||||
}
|
||||
|
||||
auto healthy_payload() -> boost::json::value {
|
||||
return boost::json::object{{"device", "zero"}, {"status", "ready"}, {"product", "product-vamp"}};
|
||||
return boost::json::object{{"device", "zero"}, {"status", "ready"}, {"product", "product_vamp"}};
|
||||
}
|
||||
|
||||
auto health_router(boost::json::value payload) -> ligo::service_router {
|
||||
@@ -247,7 +247,7 @@ BOOST_AUTO_TEST_CASE(health_rejects_wrong_device_product_status_and_payload_type
|
||||
|
||||
BOOST_AUTO_TEST_CASE(health_rejects_malformed_or_failed_envelopes_and_missing_routes) {
|
||||
for (std::char_t const *body : {"not JSON", "{}", "[]", "{\"ok\":true}", "{\"ok\":false}",
|
||||
"{\"device\":\"zero\",\"product\":\"product-vamp\",\"status\":\"ready\"}"}) {
|
||||
"{\"device\":\"zero\",\"product\":\"product_vamp\",\"status\":\"ready\"}"}) {
|
||||
auto router = ligo::service_router{};
|
||||
router.add_response_route("GET", "/api/health", [body](ligo::request_context, boost::json::value) -> boost::asio::awaitable<std::expected<ligo::service_response, modulus::error>> {
|
||||
co_return ligo::text_response("application/json", body);
|
||||
|
||||
Reference in New Issue
Block a user