SpecsServer { static WebServer getServer(int port, String routerPath, String appBase) { return SimpleWebServer.builder().setRouterPath(routerPath).setAppBase(appBase).setPort(port).build(); }  static void main(String[] args);  }
@Test public void should_use_spec() throws Exception { WebServer server = SpecsServer.getServer(WebServers.findAvailablePort(), "/api", "."); server.start(); try { HttpRequest httpRequest = HttpRequest.get(server.baseUrl() + "/api/message?who=xavier"); assertThat(httpRequest.code()).isEqualTo(200); assertThat(httpRequest.body().trim()).isEqualTo("{\"message\":\"hello xavier, it's 14:33:18\"}"); } finally { server.stop(); } }