@Test(timeout=30000)
public void testAllLocationsHealthy() throws Exception {

  final List<StorageLocation> locations =
      makeMockLocations(HEALTHY, HEALTHY, HEALTHY);
  final Configuration conf = new HdfsConfiguration();
  conf.setInt(DFS_DATANODE_FAILED_VOLUMES_TOLERATED_KEY, 0);
  StorageLocationChecker checker =
      new StorageLocationChecker(conf, new FakeTimer());
  List<StorageLocation> filteredLocations = checker.check(conf, locations);
  // All locations should be healthy.
  assertThat(filteredLocations.size(), is(3));
  // Ensure that the check method was invoked for each location.
  for (StorageLocation location : locations) {
    verify(location).check(any(StorageLocation.CheckContext.class));
  }
}