()
| 460 | } |
| 461 | |
| 462 | @Test |
| 463 | public void getLastPointMetricResolve() throws Exception { |
| 464 | Whitebox.setInternalState(config, "enable_tsuid_incrementing", false); |
| 465 | Whitebox.setInternalState(config, "enable_realtime_ts", false); |
| 466 | storage.flushStorage(); |
| 467 | tsdb.addPoint(METRIC_STRING, 1356998400L, 42, tags); |
| 468 | |
| 469 | PowerMockito.mockStatic(DateTime.class); |
| 470 | PowerMockito.when(DateTime.currentTimeMillis()).thenReturn(1356998400000L); |
| 471 | query = new TSUIDQuery(tsdb, METRIC_STRING, tags); |
| 472 | final IncomingDataPoint dp = query.getLastPoint(true, 0).join(); |
| 473 | assertEquals(1356998400000L, dp.getTimestamp()); |
| 474 | assertEquals(METRIC_STRING, dp.getMetric()); |
| 475 | assertSame(tags, dp.getTags()); |
| 476 | assertEquals("42", dp.getValue()); |
| 477 | assertEquals(UniqueId.uidToString(TSUID), dp.getTSUID()); |
| 478 | } |
| 479 | |
| 480 | @Test (expected = NoSuchUniqueName.class) |
| 481 | public void getLastPointMetricNSUNMetric() throws Exception { |
nothing calls this directly
no test coverage detected