feat(clients): enterprise: Discovery Engine, Dialogflow, Retail, Insights, CES, Recommendations
1080-row Discovery-derived call table, validating Caller, typed facades, demo under /google/enterprise, Discovery checker, live read checks. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
// Route: GET /google/enterprise/status
|
||||
#include <cstdlib>
|
||||
|
||||
#include "support/GoogleRig.hpp"
|
||||
|
||||
using namespace molo::example::test;
|
||||
|
||||
int main() {
|
||||
setenv("GOOGLE_CLOUD_PROJECT", "test-project", 1);
|
||||
{
|
||||
GoogleRig rig(false);
|
||||
Fixture f(rig.client);
|
||||
auto res = f.client->get("/google/enterprise/status");
|
||||
check(res.status == 200, "status 200 without a credential");
|
||||
check(contains(res.headers.get("Content-Type"), "application/json"), "json");
|
||||
check(contains(res.body, "\"configured\":false") && contains(res.body, "\"project_set\":true"), "state shown");
|
||||
check(contains(res.body, "discoveryengine.googleapis.com") && contains(res.body, "ces.googleapis.com") &&
|
||||
contains(res.body, "recommendationengine.googleapis.com"),
|
||||
"services listed");
|
||||
check(contains(res.body, "project=test-project"), "activation url uses the project");
|
||||
check(contains(res.body, "\"max_list_items\":500"), "caps shown");
|
||||
check(rig.mock->send_count() == 0, "side effect: no upstream traffic");
|
||||
}
|
||||
{
|
||||
GoogleRig rig;
|
||||
Fixture f(rig.client);
|
||||
auto res = f.client->get("/google/enterprise/status");
|
||||
check(contains(res.body, "\"configured\":true"), "configured with a credential");
|
||||
check(!contains(res.body, kTestKey), "credential never shown");
|
||||
check(f.client->post("/google/enterprise/status").status == 405, "post is 405");
|
||||
}
|
||||
return finish("google/enterprise/status");
|
||||
}
|
||||
Reference in New Issue
Block a user