use of org.elasticsearch.monitor.fs.FsProbe in project crate by crate.
the class SysNodeChecksTest method testGetLeastAvailablePathForDiskWatermarkChecks.
@Test
public void testGetLeastAvailablePathForDiskWatermarkChecks() throws IOException {
FsProbe fsProbe = mock(FsProbe.class);
FsInfo fsInfo = mock(FsInfo.class);
when(fsProbe.stats()).thenReturn(fsInfo);
when(fsInfo.iterator()).thenReturn(ImmutableList.of(new FsInfo.Path("/middle", "/dev/sda", 300, 170, 160), new FsInfo.Path("/most", "/dev/sdc", 300, 150, 140)).iterator());
DiskWatermarkNodesSysCheck diskWatermark = new LowDiskWatermarkNodesSysCheck(clusterService, mock(Provider.class), fsProbe);
assertThat(diskWatermark.getLeastAvailablePath().getAvailable().getBytes(), is(140L));
}
Aggregations