@Test(timeout = 10000)
public void testCheckAllVolumes() throws Exception {

  LOG.info("Executing {}", testName.getMethodName());
  final List<FsVolumeSpi> volumes = makeVolumes(
      NUM_VOLUMES, expectedVolumeHealth);
  final FsDatasetSpi<FsVolumeSpi> dataset = makeDataset(volumes);
  final DatasetVolumeChecker checker =
      new DatasetVolumeChecker(new HdfsConfiguration(), new FakeTimer());
  checker.setDelegateChecker(new DummyChecker());
  Set<FsVolumeSpi> failedVolumes = checker.checkAllVolumes(dataset);
  LOG.info("Got back {} failed volumes", failedVolumes.size());
  if (expectedVolumeHealth == null || expectedVolumeHealth == FAILED) {
    assertThat(failedVolumes.size(), is(NUM_VOLUMES));
  } else {
    assertTrue(failedVolumes.isEmpty());
  }
  // Ensure each volume's check() method was called exactly once.
  for (FsVolumeSpi volume : volumes) {
    verify(volume, times(1)).check(any());
  }
}