()
| 566 | } |
| 567 | |
| 568 | @Test |
| 569 | public void executeNSU() throws Exception { |
| 570 | final DeferredGroupException dge = mock(DeferredGroupException.class); |
| 571 | when(dge.getCause()).thenReturn(new NoSuchUniqueName("foo", "metrics")); |
| 572 | |
| 573 | when(query_result.configureFromQuery((TSQuery)any(), anyInt())) |
| 574 | .thenReturn(Deferred.fromError(dge)); |
| 575 | |
| 576 | final HttpQuery query = NettyMocks.getQuery(tsdb, |
| 577 | "/api/query?start=1h-ago&m=sum:sys.cpu.user"); |
| 578 | rpc.execute(tsdb, query); |
| 579 | assertEquals(HttpResponseStatus.BAD_REQUEST, query.response().getStatus()); |
| 580 | final String json = |
| 581 | query.response().getContent().toString(Charset.forName("UTF-8")); |
| 582 | assertTrue(json.contains("No such name for 'foo': 'metrics'")); |
| 583 | } |
| 584 | |
| 585 | @Test |
| 586 | public void executeWithBadDSFill() throws Exception { |
nothing calls this directly
no test coverage detected