Files

19 lines
717 B
C++
Raw Permalink Normal View History

// Route: /replication/state (append plus since)
#include "support/Assert.hpp"
using namespace molo::example::test;
int main() {
Fixture f;
auto add = f.client->post("/replication/state",
"{\"object\":\"doc-1\",\"data\":\"v1\"}",
"application/json");
check(add.status == 201, "append is 201");
check(contains(add.body, "last-writer-wins"), "conflict rule named");
auto full = f.client->get("/replication/state?since=0");
check(contains(full.body, "doc-1"), "entry replicated");
auto empty = f.client->get("/replication/state?since=99");
check(contains(empty.body, "\"entries\":[]"), "cursor filters");
return finish("replication/state");
}