()
| 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 { |
nothing calls this directly
no test coverage detected