Package restx.server

Examples of restx.server.WebServer.baseUrl()


    public RunningServer start() throws Exception {
        System.setProperty("restx.mode", RestxContext.Modes.INFINIREST);
        WebServer server = webServerSupplier.newWebServer(port);
        server.start();
        RestxSpecLoader specLoader = new RestxSpecLoader(factory);
        RestxSpecRunner runner = new RestxSpecRunner(specLoader, routerPath, server.getServerId(), server.baseUrl(), factory);
        RestxSpecRepository repository = new HotReloadRestxSpecRepository(specLoader);

        final RunningServer runningServer = new RunningServer(
                server, runner, repository,
                factory.getComponent(UUIDGenerator.class),
View Full Code Here


    @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();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.