@Override
    public int getServerPort() {
        if (port == 0) {
            VertxPlatformHttpServer server = CamelContextHelper.findSingleByType(camelContext, VertxPlatformHttpServer.class);
            if (server != null && server.getServer() != null) {
                port = server.getServer().actualPort();
            }
            if (port == 0) {
                VertxPlatformHttpServerConfiguration config
                        = CamelContextHelper.findSingleByType(camelContext, VertxPlatformHttpServerConfiguration.class);
                if (config != null) {
                    port = config.getBindPort();
                }
            }
            if (port == 0) {
                VertxPlatformHttpRouter router = VertxPlatformHttpRouter.lookup(camelContext);
                if (router != null && router.getServer() != null && router.getServer().getServer() != null) {
                    port = router.getServer().getServer().actualPort();
                }
            }
        }
        return port;
    }
@Test
    public void testEngine() throws Exception {
        final CamelContext context = createCamelContext();

        try {
            context.addRoutes(new RouteBuilder() {
                @Override
                public void configure() {
                    from("platform-http:/get")
                            .routeId("get")
                            .setBody().constant("get");
                    from("platform-http:/post")
                            .routeId("post")
                            .transform().body(String.class, b -> b.toUpperCase());
                }
            });

            context.start();

            given()
                    .when()
                    .get("/get")
                    .then()
                    .statusCode(200)
                    .body(equalTo("get"));

            given()
                    .body("post")
                    .when()
                    .post("/post")
                    .then()
                    .statusCode(200)
                    .body(equalTo("POST"));

            PlatformHttpComponent phc = context.getComponent("platform-http", PlatformHttpComponent.class);
            assertEquals(2, phc.getHttpEndpoints().size());
            Iterator<HttpEndpointModel> it = phc.getHttpEndpoints().iterator();
            assertEquals("/get", it.next().getUri());
            assertEquals("/post", it.next().getUri());

            // should find engine in registry
            assertNotNull(context.getRegistry().findSingleByType(PlatformHttpEngine.class));
            EmbeddedHttpService server = context.getRegistry().findSingleByType(EmbeddedHttpService.class);
            assertNotNull(server);
            assertEquals("http", server.getScheme());
            assertEquals(RestAssured.port, server.getServerPort());
        } finally {
            context.stop();
        }
    }