@Test void daemonThreadCountIsCalculated() { when(this.threadBean.getDaemonThreadCount()).thenReturn(10).thenReturn(9).thenReturn(11).thenReturn(10); this.cut.gather(); this.cut.gather(); this.cut.gather(); this.cut.gather(); ThreadInformationData collector = (ThreadInformationData) this.cut.get(); assertThat(collector.getMinDaemonThreadCount(), is(9)); assertThat(collector.getMaxDaemonThreadCount(), is(11)); assertThat(collector.getTotalDaemonThreadCount(), is(40)); }
@Test void peakThreadCountIsCalculated() { when(this.threadBean.getPeakThreadCount()).thenReturn(10).thenReturn(9).thenReturn(11).thenReturn(10); this.cut.gather(); this.cut.gather(); this.cut.gather(); this.cut.gather(); ThreadInformationData collector = (ThreadInformationData) this.cut.get(); assertThat(collector.getMinPeakThreadCount(), is(9)); assertThat(collector.getMaxPeakThreadCount(), is(11)); assertThat(collector.getTotalPeakThreadCount(), is(40)); }
@Test void threadCountIsCalculated() { when(this.threadBean.getThreadCount()).thenReturn(10).thenReturn(9).thenReturn(11).thenReturn(10); this.cut.gather(); this.cut.gather(); this.cut.gather(); this.cut.gather(); ThreadInformationData collector = (ThreadInformationData) this.cut.get(); assertThat(collector.getMinThreadCount(), is(9)); assertThat(collector.getMaxThreadCount(), is(11)); assertThat(collector.getTotalThreadCount(), is(40)); }
int daemonThreadCount = this.getThreadBean().getDaemonThreadCount(); int peakThreadCount = this.getThreadBean().getPeakThreadCount(); int threadCount = this.getThreadBean().getThreadCount(); long totalStartedThreadCount = this.getThreadBean().getTotalStartedThreadCount();
@Test void totalStartedThreadCountIsCalculated() { when(this.threadBean.getTotalStartedThreadCount()).thenReturn(10L).thenReturn(9L).thenReturn(11L).thenReturn(10L); this.cut.gather(); this.cut.gather(); this.cut.gather(); this.cut.gather(); ThreadInformationData collector = (ThreadInformationData) this.cut.get(); assertThat(collector.getMinTotalStartedThreadCount(), is(9L)); assertThat(collector.getMaxTotalStartedThreadCount(), is(11L)); assertThat(collector.getTotalTotalStartedThreadCount(), is(40L)); }