@Test public void shouldHandleNoLoadForDriveWithThatName() { Optional<DriveLoad> diskInfo = provider.driveLoadByName("/dev/sda3"); assertFalse(diskInfo.isPresent()); }
@Override public Optional<DriveLoad> driveLoadByName(String name) { return hal.getDiskStores().stream() .filter(n -> n.getName().equalsIgnoreCase(name)) .map(this::createDiskLoad) .findAny(); }
DefaultDriveProvider implements DriveMetrics { @Override public Optional<DriveLoad> driveLoadByName(String name) { return hal.getDiskStores().stream() .filter(n -> n.getName().equalsIgnoreCase(name)) .map(this::createDiskLoad) .findAny(); } }
DefaultDriveProvider implements DriveMetrics { @Override public Optional<DriveLoad> driveLoadByName(String name) { return hal.getDiskStores().stream() .filter(n -> n.getName().equalsIgnoreCase(name)) .map(this::createDiskLoad) .findAny(); } protected  DefaultDriveProvider(OperatingSystem operatingSystem, HardwareAbstractionLayer hal, SpeedMeasurementManager speedMeasurementManager); }
DefaultDriveProvider implements DriveMetrics { @Override public Optional<DriveLoad> driveLoadByName(String name) { return hal.getDiskStores().stream() .filter(n -> n.getName().equalsIgnoreCase(name)) .map(this::createDiskLoad) .findAny(); } protected  DefaultDriveProvider(OperatingSystem operatingSystem, HardwareAbstractionLayer hal, SpeedMeasurementManager speedMeasurementManager); void register(); @Override List<Drive> drives(); @Override List<DriveLoad> driveLoads(); @Override Optional<DriveLoad> driveLoadByName(String name); @Override Optional<Drive> driveByName(String name); DriveHealth diskHealth(String name); }
DefaultDriveProvider implements DriveMetrics { @Override public Optional<DriveLoad> driveLoadByName(String name) { return hal.getDiskStores().stream() .filter(n -> n.getName().equalsIgnoreCase(name)) .map(this::createDiskLoad) .findAny(); } protected  DefaultDriveProvider(OperatingSystem operatingSystem, HardwareAbstractionLayer hal, SpeedMeasurementManager speedMeasurementManager); void register(); @Override List<Drive> drives(); @Override List<DriveLoad> driveLoads(); @Override Optional<DriveLoad> driveLoadByName(String name); @Override Optional<Drive> driveByName(String name); DriveHealth diskHealth(String name);  }