@Test void countIsIncremented() { this.cut.gather(); this.cut.gather(); ThreadInformationData collector = (ThreadInformationData) this.cut.get(); assertThat(collector.getCount(), is(2)); } }
ThreadInformationData threadInformationData = (ThreadInformationData) this.cut.get();
ThreadInformationData threadInformationData = (ThreadInformationData) this.cut.get();
@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)); }
@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)); }
@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)); }