()
| 648 | } |
| 649 | |
| 650 | @Test |
| 651 | public void gexp() throws Exception { |
| 652 | final DataPoints[] datapoints = new DataPoints[1]; |
| 653 | datapoints[0] = new MockDataPoints().getMock(); |
| 654 | when(query_result.runAsync()).thenReturn( |
| 655 | Deferred.fromResult(datapoints)); |
| 656 | |
| 657 | final HttpQuery query = NettyMocks.getQuery(tsdb, |
| 658 | "/api/query/gexp?start=1h-ago&exp=scale(sum:sys.cpu.user,1)"); |
| 659 | NettyMocks.mockChannelFuture(query); |
| 660 | rpc.execute(tsdb, query); |
| 661 | assertEquals(query.response().getStatus(), HttpResponseStatus.OK); |
| 662 | final String json = |
| 663 | query.response().getContent().toString(Charset.forName("UTF-8")); |
| 664 | assertTrue(json.contains("\"metric\":\"system.cpu.user\"")); |
| 665 | } |
| 666 | |
| 667 | @Test |
| 668 | public void gexpBadExpression() throws Exception { |
nothing calls this directly
no test coverage detected