use of org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpRequest in project cdap by caskdata.
the class RouterPathTest method testRouterFlowPathLookUp.
@Test
public void testRouterFlowPathLookUp() throws Exception {
String flowPath = "/v3/namespaces/default//apps/ResponseCodeAnalytics/flows/LogAnalyticsFlow/status";
HttpRequest httpRequest = new DefaultHttpRequest(VERSION, new HttpMethod("GET"), flowPath);
RouteDestination result = pathLookup.getRoutingService(FALLBACKSERVICE, flowPath, httpRequest);
Assert.assertEquals(RouterPathLookup.APP_FABRIC_HTTP, result);
}
use of org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpRequest in project cdap by caskdata.
the class RouterPathTest method testMetricsPath.
private void testMetricsPath(String path) {
HttpRequest httpRequest = new DefaultHttpRequest(VERSION, new HttpMethod("GET"), path);
RouteDestination result = pathLookup.getRoutingService(FALLBACKSERVICE, path, httpRequest);
Assert.assertEquals(RouterPathLookup.METRICS, result);
}
use of org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpRequest in project cdap by caskdata.
the class RouterPathTest method testRouterFeedsLookup.
@Test
public void testRouterFeedsLookup() {
final String namespacePath = "/v3//feeds/test";
HttpRequest httpRequest = new DefaultHttpRequest(VERSION, new HttpMethod("PUT"), namespacePath);
RouteDestination result = pathLookup.getRoutingService(FALLBACKSERVICE, namespacePath, httpRequest);
Assert.assertEquals(null, result);
}
use of org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpRequest in project cdap by caskdata.
the class RouterPathTest method testAppFabricPath.
@Test
public void testAppFabricPath() throws Exception {
// Default destination for URIs will APP_FABRIC_HTTP
String path = "/v3/ping/";
HttpRequest httpRequest = new DefaultHttpRequest(VERSION, new HttpMethod("GET"), path);
RouteDestination result = pathLookup.getRoutingService(FALLBACKSERVICE, path, httpRequest);
Assert.assertEquals(RouterPathLookup.APP_FABRIC_HTTP, result);
path = "/status";
httpRequest = new DefaultHttpRequest(VERSION, new HttpMethod("GET"), path);
result = pathLookup.getRoutingService(FALLBACKSERVICE, path, httpRequest);
Assert.assertEquals(RouterPathLookup.APP_FABRIC_HTTP, result);
path = "/v3/monitor///abcd/";
httpRequest = new DefaultHttpRequest(VERSION, new HttpMethod("POST"), path);
result = pathLookup.getRoutingService(FALLBACKSERVICE, path, httpRequest);
Assert.assertEquals(RouterPathLookup.APP_FABRIC_HTTP, result);
}
use of org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpRequest in project cdap by caskdata.
the class RouterPathTest method testRouterDeployPathLookUp.
@Test
public void testRouterDeployPathLookUp() throws Exception {
String path = "/v3/namespaces/default//apps/";
HttpRequest httpRequest = new DefaultHttpRequest(VERSION, new HttpMethod("PUT"), path);
RouteDestination result = pathLookup.getRoutingService(FALLBACKSERVICE, path, httpRequest);
Assert.assertEquals(RouterPathLookup.APP_FABRIC_HTTP, result);
}
Aggregations