Search in sources :

Example 1 with NettyRouter

use of io.cdap.cdap.gateway.router.NettyRouter in project cdap by caskdata.

the class MasterServiceMainTestBase method getRouterBaseURI.

/**
 * Returns the base URI for the router.
 */
static URI getRouterBaseURI() {
    NettyRouter router = getServiceMainInstance(RouterServiceMain.class).getInjector().getInstance(NettyRouter.class);
    InetSocketAddress addr = router.getBoundAddress().orElseThrow(IllegalStateException::new);
    return URI.create(String.format("https://%s:%d/", addr.getHostName(), addr.getPort()));
}
Also used : InetSocketAddress(java.net.InetSocketAddress) NettyRouter(io.cdap.cdap.gateway.router.NettyRouter)

Aggregations

NettyRouter (io.cdap.cdap.gateway.router.NettyRouter)1 InetSocketAddress (java.net.InetSocketAddress)1