@Test public void shouldSampleTheIndexButDoNotStoreTheValuesIfTheIndexIsNotOnline() { // given OnlineIndexSamplingJob job = new OnlineIndexSamplingJob(indexProxy, indexStoreView, "Foo", logging); when(indexProxy.getState()).thenReturn(FAILED); // when job.run(); // then verifyNoMoreInteractions(indexStoreView); }
@Test public void shouldSampleTheIndexAndStoreTheValueWhenTheIndexIsOnline() { // given OnlineIndexSamplingJob job = new OnlineIndexSamplingJob(indexProxy, indexStoreView, "Foo", logging); when(indexProxy.getState()).thenReturn(ONLINE); // when job.run(); // then verify(indexStoreView) .replaceIndexCounts(indexDescriptor, indexUniqueValues, indexSize, indexSize); verifyNoMoreInteractions(indexStoreView); }