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,20 @@
|
||||
// Route: /pubsub/publish
|
||||
#include "support/Assert.hpp"
|
||||
|
||||
using namespace molo::example::test;
|
||||
|
||||
int main() {
|
||||
Fixture f;
|
||||
int seen = 0;
|
||||
f.services.pubsub->subscribe("news",
|
||||
[&](const std::string&) { ++seen; });
|
||||
auto pub = f.client->post("/pubsub/publish",
|
||||
"{\"topic\":\"news\",\"message\":\"hi\"}",
|
||||
"application/json");
|
||||
check(pub.status == 200, "publish status 200");
|
||||
check(contains(pub.body, "\"delivered\":1"), "one subscriber reached");
|
||||
check(seen == 1, "side effect: listener ran");
|
||||
auto hist = f.client->get("/pubsub/publish?topic=news");
|
||||
check(contains(hist.body, "hi"), "history kept");
|
||||
return finish("pubsub/publish");
|
||||
}
|
||||
Reference in New Issue
Block a user