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

Method testSplitsEligibleRollupQuery

test/core/TestTSQuery.java:638–656  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

636 }
637
638 @Test
639 public void testSplitsEligibleRollupQuery() throws Exception {
640 final TSQuery queryUnderTest = getMetricForValidate();
641
642 TSDB tsdb = PowerMockito.mock(TSDB.class);
643 TsdbQuery mockTsdbQuery = PowerMockito.mock(TsdbQuery.class);
644 when(mockTsdbQuery.configureFromQuery(eq(queryUnderTest), anyInt())).thenReturn(Deferred.fromResult(null));
645 when(mockTsdbQuery.needsSplitting()).thenReturn(true);
646 when(tsdb.newQuery()).thenReturn(mockTsdbQuery);
647
648 SplitRollupQuery mockSplitQuery = PowerMockito.mock(SplitRollupQuery.class);
649 when(mockSplitQuery.configureFromQuery(eq(queryUnderTest), anyInt())).thenReturn(Deferred.fromResult(null));
650
651 PowerMockito.whenNew(SplitRollupQuery.class).withAnyArguments().thenReturn(mockSplitQuery);
652
653 queryUnderTest.buildQueriesAsync(tsdb);
654
655 verify(mockSplitQuery).configureFromQuery(queryUnderTest, 0);
656 }
657
658 @Test
659 public void testDoesNotSplitIneligibleRollupQuery() {

Callers

nothing calls this directly

Calls 7

getMetricForValidateMethod · 0.95
configureFromQueryMethod · 0.95
needsSplittingMethod · 0.95
newQueryMethod · 0.95
configureFromQueryMethod · 0.95
buildQueriesAsyncMethod · 0.95
configureFromQueryMethod · 0.65

Tested by

no test coverage detected