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

Method executePOSTDuplicates

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

Source from the content-addressed store, hash-verified

619 }
620
621 @Test
622 public void executePOSTDuplicates() throws Exception {
623 final DataPoints[] datapoints = new DataPoints[1];
624 datapoints[0] = new MockDataPoints().getMock();
625 when(query_result.runAsync()).thenReturn(
626 Deferred.fromResult(datapoints));
627
628 final HttpQuery query = NettyMocks.postQuery(tsdb,"/api/query",
629 "{\"start\":\"1h-ago\",\"queries\":" +
630 "[{\"metric\":\"sys.cpu.user\",\"aggregator\":\"sum\"},"
631 + "{\"metric\":\"sys.cpu.user\",\"aggregator\":\"sum\"}]}");
632 NettyMocks.mockChannelFuture(query);
633 rpc.execute(tsdb, query);
634 final String json =
635 query.response().getContent().toString(Charset.forName("UTF-8"));
636 assertTrue(json.contains("\"metric\":\"system.cpu.user\""));
637 }
638
639 @Test (expected = BadRequestException.class)
640 public void deleteDatapointsBadRequest() 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