### Question:
Engine extends Rule<Engine> { public Response get(String url) { return service("GET", url, null); } Engine();  Engine(Api... apis); static void applyPathParams(Map<String, String> pathParams, Url url, JSNode json); synchronized Engine startup(); void shutdown(); Response get(String url); Response get(String url, Map<String, String> params); Response get(String url, List queryTerms); Response post(String url, JSNode body); Response put(String url, JSNode body); Response patch(String url, JSNode body); Response delete(String url); Response delete(String url, JSArray hrefs); Response service(String method, String url); Response service(String method, String url, String body); Response service(String method, String url, String body, Map<String, String> params); Chain service(Request req, Response res); boolean isStarted(); Engine withEngineListener(EngineListener listener); List<Api> getApis(); synchronized Api getApi(String apiName); synchronized Engine withApi(Api api); synchronized void removeApi(Api api); Engine withAllowHeaders(String allowHeaders); Response getLastResponse(); URL getResource(String name); String getConfigPath(); Engine withConfigPath(String configPath); String getConfigProfile(); Engine withConfigProfile(String configProfile);  }### Answer:
@Test public void testPathVariables() { Api api1 = new Api("api1").withEndpoint("*", "ep1/*", new MockAction()); Api api2 = new Api("api2").withEndpoint("*", "ep2/*", new MockAction()); Engine e = new Engine(api1, api2); Request req; Response res; res = e.get("http: res.dump(); req = res.getChain().getRequest(); assertNotNull(req.getEndpoint()); assertEquals(new Path("ep1"), req.getEndpointPath()); assertEquals(new Path("api1"), req.getApiPath()); e.clearIncludeRuleMatchers(); e.withIncludeOn(null, "/some/servlet/path/*"); res = e.get("http: res.dump(); req = res.getChain().getRequest(); assertNotNull(req.getEndpoint()); assertEquals(new Path("ep1"), req.getEndpointPath()); assertEquals(new Path("api1"), req.getApiPath()); api1.clearIncludeRuleMatchers(); api1.withIncludeOn(null, new Path("api1/v1/*")); res = e.get("http: assertEquals(400, res.getStatusCode()); req = res.getChain().getRequest(); assertNull(req.getEndpoint()); req = e.get("http: assertNotNull(req.getEndpoint()); assertEquals(new Path("ep1"), req.getEndpointPath()); assertEquals(new Path("api1/v1"), req.getApiPath()); api1.clearIncludeRuleMatchers(); api1.withIncludeOn(null, "api1/v1/:tenant/*"); res = e.get("http: req = res.getChain().getRequest(); assertNotNull(req.getEndpoint()); assertEquals(new Path("ep1"), req.getEndpointPath()); assertEquals(new Path("api1/v1/acme"), req.getApiPath()); api1.withCollection(new Collection("employees")); res = e.get("http: req = res.getChain().getRequest(); assertEquals("employees", req.getUrl().getParam("_collection")); assertEquals("12345", req.getUrl().getParam("_resource")); assertEquals("reportsTo", req.getUrl().getParam("_relationship")); api1.withCollection(new Collection("employees")); res = e.get("http: res.dump(); System.out.println(res.getChain().getRequest().getUrl()); }