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,16 @@
|
||||
// Route: GET /routing/hello/{name}
|
||||
#include "support/Assert.hpp"
|
||||
|
||||
using namespace molo::example::test;
|
||||
|
||||
int main() {
|
||||
Fixture f;
|
||||
auto res = f.client->get("/routing/hello/ada");
|
||||
check(res.status == 200, "status 200");
|
||||
check(contains(res.body, "\"hello\":\"ada\""), "path param bound");
|
||||
auto encoded = f.client->get("/routing/hello/a%20b");
|
||||
check(contains(encoded.body, "\"hello\":\"a b\""), "param url-decoded");
|
||||
auto missing = f.client->get("/routing/hello");
|
||||
check(missing.status == 404, "missing segment is 404");
|
||||
return finish("routing/hello");
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// Route: /routing/routers/nested/deep (nested router include)
|
||||
#include "support/Assert.hpp"
|
||||
|
||||
using namespace molo::example::test;
|
||||
|
||||
int main() {
|
||||
Fixture f;
|
||||
auto res = f.client->get("/routing/routers/nested/deep");
|
||||
check(res.status == 200, "status 200");
|
||||
check(contains(res.body, "\"nested\":true"), "nested router reached");
|
||||
auto shallow = f.client->get("/routing/routers");
|
||||
check(shallow.status == 404, "prefix alone is 404");
|
||||
return finish("routing/routers");
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// Route: /routing/views/greet (class-based view, GET plus POST)
|
||||
#include "support/Assert.hpp"
|
||||
|
||||
using namespace molo::example::test;
|
||||
|
||||
int main() {
|
||||
Fixture f;
|
||||
auto get = f.client->get("/routing/views/greet?name=grace");
|
||||
check(get.status == 200, "GET status 200");
|
||||
check(contains(get.body, "GreetView"), "view dispatched GET");
|
||||
check(contains(get.body, "grace"), "query value used");
|
||||
auto post = f.client->post("/routing/views/greet", "name=ada",
|
||||
"application/x-www-form-urlencoded");
|
||||
check(post.status == 200, "POST status 200");
|
||||
check(contains(post.body, "\"method\":\"POST\""), "view dispatched POST");
|
||||
auto put = f.client->request(molo::example::fw::Method::Put,
|
||||
"/routing/views/greet");
|
||||
check(put.status == 404 || put.status == 405,
|
||||
"unregistered method rejected");
|
||||
return finish("routing/views");
|
||||
}
|
||||
Reference in New Issue
Block a user