()
| 550 | } |
| 551 | |
| 552 | @Test |
| 553 | public void nsunMetric() throws Exception { |
| 554 | oneExtraSameE(); |
| 555 | final Metric metric1 = Metric.Builder().setMetric("A").setId("a") |
| 556 | .setFilter("f1").setAggregator("sum").build(); |
| 557 | final Metric metric2 = Metric.Builder().setMetric(NSUN_METRIC).setId("b") |
| 558 | .setFilter("f1").setAggregator("sum").build(); |
| 559 | metrics = Arrays.asList(metric1, metric2); |
| 560 | final String json = JSON.serializeToString(getDefaultQueryBuilder().build()); |
| 561 | |
| 562 | final QueryRpc rpc = new QueryRpc(); |
| 563 | final HttpQuery query = NettyMocks.postQuery(tsdb, |
| 564 | "/api/query/exp", json); |
| 565 | query.getQueryBaseRoute(); // to the correct serializer |
| 566 | NettyMocks.mockChannelFuture(query); |
| 567 | |
| 568 | rpc.execute(tsdb, query); |
| 569 | final String response = |
| 570 | query.response().getContent().toString(Charset.forName("UTF-8")); |
| 571 | assertTrue(response.contains("\"code\":400")); |
| 572 | assertTrue(response.contains("\"message\":\"No such name for '" + |
| 573 | NSUN_METRIC + "'")); |
| 574 | } |
| 575 | |
| 576 | @Test |
| 577 | public void selfReferencingExpression() throws Exception { |
nothing calls this directly
no test coverage detected