BillingApiHandler extends LoggingRequestHandler { private HttpResponse getPlan(String tenant) { var plan = billingController.getPlan(TenantName.from(tenant)); var slime = new Slime(); var root = slime.setObject(); root.setString("tenant", tenant); root.setString("plan", plan.value()); return new SlimeJsonResponse(slime); } BillingApiHandler(Executor executor,
                             AccessLog accessLog,
                             Controller controller); @Override HttpResponse handle(HttpRequest request);  }
@Test public void setting_plans() { var planRequest = request("/billing/v1/tenant/tenant1/plan", PATCH) .data("{\"plan\": \"new-plan\"}") .roles(tenantRole); tester.assertResponse(planRequest, "Plan: new-plan"); assertEquals("new-plan", billingController.getPlan(tenant).value()); }