MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / executePOST

Method executePOST

test/tsd/TestQueryRpc.java:604–619  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

602 }
603
604 @Test
605 public void executePOST() throws Exception {
606 final DataPoints[] datapoints = new DataPoints[1];
607 datapoints[0] = new MockDataPoints().getMock();
608 when(query_result.runAsync()).thenReturn(
609 Deferred.fromResult(datapoints));
610
611 final HttpQuery query = NettyMocks.postQuery(tsdb,"/api/query",
612 "{\"start\":\"1h-ago\",\"queries\":" +
613 "[{\"metric\":\"sys.cpu.user\",\"aggregator\":\"sum\"}]}");
614 NettyMocks.mockChannelFuture(query);
615 rpc.execute(tsdb, query);
616 final String json =
617 query.response().getContent().toString(Charset.forName("UTF-8"));
618 assertTrue(json.contains("\"metric\":\"system.cpu.user\""));
619 }
620
621 @Test
622 public void executePOSTDuplicates() throws Exception {

Callers

nothing calls this directly

Calls 9

postQueryMethod · 0.95
mockChannelFutureMethod · 0.95
getMockMethod · 0.80
responseMethod · 0.80
containsMethod · 0.80
runAsyncMethod · 0.65
executeMethod · 0.65
toStringMethod · 0.45
getContentMethod · 0.45

Tested by

no test coverage detected