Files
moloapp/tests/example/agent/registry/search_test.cpp
T

20 lines
620 B
C++
Raw Normal View History

// Route: POST /agent/registry/search
#include "agent/registry/cases.hpp"
using namespace molo::example::test;
int main() {
check_google_post_route("/agent/registry/search",
"{\"kind\":\"agents\",\"q\":\"billing\"}",
"{\"kind\":\"endpoints\",\"q\":\"x\"}",
"search on endpoints");
{
GoogleRig rig;
Fixture f(rig.client);
std::string long_q(600, 'x');
check(f.client->post("/agent/registry/search", "{\"kind\":\"agents\",\"q\":\"" + long_q + "\"}", "application/json").status == 422,
"limit: query over 512 chars is 422");
}
return finish("agent/registry/search");
}