feat: implement MoloApp plans 01-15 with integration
Full C++23 framework tree: runtime, observability, security, data, app, realtime, supervisor, clients, CLI, example plus enterprise tenancy, audit, operability, governance, supplychain. Postgres via docker compose for tests.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
// Route: GET /formats/data (content negotiation)
|
||||
#include "support/Assert.hpp"
|
||||
|
||||
using namespace molo::example::test;
|
||||
using molo::example::fw::Method;
|
||||
|
||||
int main() {
|
||||
Fixture f;
|
||||
auto def = f.client->get("/formats/data");
|
||||
check(contains(def.headers.get("Content-Type"), "application/json"),
|
||||
"default is json");
|
||||
auto xml = f.client->request(Method::Get, "/formats/data", "",
|
||||
{{"Accept", "application/xml"}});
|
||||
check(contains(xml.headers.get("Content-Type"), "application/xml"),
|
||||
"xml negotiated");
|
||||
check(contains(xml.body, "<value>42</value>"), "xml body");
|
||||
auto weighted = f.client->request(
|
||||
Method::Get, "/formats/data", "",
|
||||
{{"Accept", "text/html;q=0.2, text/plain;q=0.9"}});
|
||||
check(contains(weighted.headers.get("Content-Type"), "text/plain"),
|
||||
"q weights honored");
|
||||
auto nope = f.client->request(Method::Get, "/formats/data", "",
|
||||
{{"Accept", "image/png"}});
|
||||
check(nope.status == 406, "no match is 406");
|
||||
return finish("formats/data");
|
||||
}
|
||||
Reference in New Issue
Block a user