@Test public void isNotInitializedWhenKvsIsNotInitialized() { KeyValueService mockKvs = mock(KeyValueService.class); ScrubberStore mockStore = mock(ScrubberStore.class); when(mockKvs.isInitialized()).thenReturn(false); when(mockStore.isInitialized()).thenReturn(true); Scrubber theScrubber = getScrubber(mockKvs, mockStore, transactions); assertFalse(theScrubber.isInitialized()); }
public boolean isInitialized() { return keyValueService.isInitialized() && scrubberStore.isInitialized(); }
Scrubber { public boolean isInitialized() { return keyValueService.isInitialized() && scrubberStore.isInitialized(); } }
Scrubber { public boolean isInitialized() { return keyValueService.isInitialized() && scrubberStore.isInitialized(); } private  Scrubber(KeyValueService keyValueService,
                     ScrubberStore scrubberStore,
                     Supplier<Long> backgroundScrubFrequencyMillisSupplier,
                     Supplier<Boolean> isScrubEnabled,
                     Supplier<Long> unreadableTimestampSupplier,
                     Supplier<Long> immutableTimestampSupplier,
                     TransactionService transactionService,
                     final boolean aggressiveScrub,
                     Supplier<Integer> batchSizeSupplier,
                     int threadCount,
                     int readThreadCount,
                     Collection<Follower> followers,
                     MetricsManager metricsManager); }
Scrubber { public boolean isInitialized() { return keyValueService.isInitialized() && scrubberStore.isInitialized(); } private  Scrubber(KeyValueService keyValueService,
                     ScrubberStore scrubberStore,
                     Supplier<Long> backgroundScrubFrequencyMillisSupplier,
                     Supplier<Boolean> isScrubEnabled,
                     Supplier<Long> unreadableTimestampSupplier,
                     Supplier<Long> immutableTimestampSupplier,
                     TransactionService transactionService,
                     final boolean aggressiveScrub,
                     Supplier<Integer> batchSizeSupplier,
                     int threadCount,
                     int readThreadCount,
                     Collection<Follower> followers,
                     MetricsManager metricsManager); static Scrubber create(KeyValueService keyValueService,
                                  ScrubberStore scrubberStore,
                                  Supplier<Long> backgroundScrubFrequencyMillisSupplier,
                                  Supplier<Boolean> isScrubEnabled,
                                  Supplier<Long> unreadableTimestampSupplier,
                                  Supplier<Long> immutableTimestampSupplier,
                                  TransactionService transactionService,
                                  boolean aggressiveScrub,
                                  Supplier<Integer> batchSizeSupplier,
                                  int threadCount,
                                  int readThreadCount,
                                  Collection<Follower> followers,
                                  MetricsManager metricsManager); boolean isInitialized(); long getUnreadableTimestamp(); void start(TransactionManager txManager); void shutdown(); }
Scrubber { public boolean isInitialized() { return keyValueService.isInitialized() && scrubberStore.isInitialized(); } private  Scrubber(KeyValueService keyValueService,
                     ScrubberStore scrubberStore,
                     Supplier<Long> backgroundScrubFrequencyMillisSupplier,
                     Supplier<Boolean> isScrubEnabled,
                     Supplier<Long> unreadableTimestampSupplier,
                     Supplier<Long> immutableTimestampSupplier,
                     TransactionService transactionService,
                     final boolean aggressiveScrub,
                     Supplier<Integer> batchSizeSupplier,
                     int threadCount,
                     int readThreadCount,
                     Collection<Follower> followers,
                     MetricsManager metricsManager); static Scrubber create(KeyValueService keyValueService,
                                  ScrubberStore scrubberStore,
                                  Supplier<Long> backgroundScrubFrequencyMillisSupplier,
                                  Supplier<Boolean> isScrubEnabled,
                                  Supplier<Long> unreadableTimestampSupplier,
                                  Supplier<Long> immutableTimestampSupplier,
                                  TransactionService transactionService,
                                  boolean aggressiveScrub,
                                  Supplier<Integer> batchSizeSupplier,
                                  int threadCount,
                                  int readThreadCount,
                                  Collection<Follower> followers,
                                  MetricsManager metricsManager); boolean isInitialized(); long getUnreadableTimestamp(); void start(TransactionManager txManager); void shutdown();  }