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

Method executeNSU

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

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 9

getQueryMethod · 0.95
getCauseMethod · 0.80
responseMethod · 0.80
containsMethod · 0.80
configureFromQueryMethod · 0.65
executeMethod · 0.65
getStatusMethod · 0.65
toStringMethod · 0.45
getContentMethod · 0.45

Tested by

no test coverage detected