Files
moloapp/tests/example/v1/items_test.cpp
T
retoorandClaude Sonnet 5.5 62fdd08da8 feat(workflow): example covers security, platform, enterprise and resilience features
105 route tests, matrix crawl, spec and README updated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 02:19:52 +02:00

18 lines
727 B
C++

// Route: GET /v1/items (deprecated version: Deprecation, Sunset, Link)
#include "support/Assert.hpp"
using namespace molo::example::test;
using molo::example::fw::Method;
int main() {
Fixture f;
auto r = f.client->get("/v1/items");
check(r.status == 200 && contains(r.body, "\"v1\""), "ok");
check(r.headers.get("Deprecation") == "true", "Deprecation header");
check(contains(r.headers.get("Sunset"), "GMT"), "Sunset header");
check(contains(r.headers.get("Link"), "successor-version") && contains(r.headers.get("Link"), "/v2/items"), "Link successor");
check(f.client->post("/v1/items").status == 405, "405 on post");
check(f.client->get("/v1/nothing").status == 404, "404");
return finish("v1/items");
}