@Test void freeSwapSpaceIsCalculated() { this.mockCollectorWithDefaults(); when(this.osBean.getFreeSwapSpaceSize()).thenReturn(10L).thenReturn(9L).thenReturn(11L).thenReturn(10L); this.cut.gather(); this.cut.gather(); this.cut.gather(); this.cut.gather(); MemoryInformationData collector = (MemoryInformationData) this.cut.get(); assertThat(collector.getMinFreeSwapSpace(), is(9L)); assertThat(collector.getMaxFreeSwapSpace(), is(11L)); assertThat(collector.getTotalFreeSwapSpace(), is(40L)); }
assertThat(memoryInformationData.getMinFreeSwapSpace(), is(Long.MAX_VALUE)); assertThat(memoryInformationData.getMaxFreeSwapSpace(), is(0L));
assertThat(memoryInformationData.getMinFreeSwapSpace(), is(8L)); assertThat(memoryInformationData.getMaxFreeSwapSpace(), is(9L));
if (freeSwapSpace < this.memoryInformationData.getMinFreeSwapSpace()) { this.memoryInformationData.setMinFreeSwapSpace(freeSwapSpace); } else if (freeSwapSpace > this.memoryInformationData.getMaxFreeSwapSpace()) {
newMemoryInformationData.setMinFreeSwapSpace(this.memoryInformationData.getMinFreeSwapSpace()); newMemoryInformationData.setMaxFreeSwapSpace(this.memoryInformationData.getMaxFreeSwapSpace());