@Test public void testGetMonitored() { when(rejectedThreadService.getAllRejectedCluster()) .thenReturn(Arrays.asList(rejectedThread(3), rejectedThread(2), rejectedThread(6), rejectedThread(4), rejectedThread(10), rejectedThread(6))); List<RejectedThread> monitored = underTest.getMonitored(); Long[] collect = new Long[6]; monitored.stream().map(RejectedThread::getRejectedCount).collect(Collectors.toList()).toArray(collect); Assert.assertArrayEquals(collect, new Long[]{10L, 6L, 6L, 4L, 3L, 2L}); }
@Override protected List<RejectedThread> getMonitored() { List<RejectedThread> allRejectedCluster = getRejectedThreadService().getAllRejectedCluster(); allRejectedCluster.sort(this::compareRejectedThreadsByCount); return allRejectedCluster; }
RejectedThreadMonitor extends AbstractMonitor<RejectedThread> { @Override protected List<RejectedThread> getMonitored() { List<RejectedThread> allRejectedCluster = getRejectedThreadService().getAllRejectedCluster(); allRejectedCluster.sort(this::compareRejectedThreadsByCount); return allRejectedCluster; } }
RejectedThreadMonitor extends AbstractMonitor<RejectedThread> { @Override protected List<RejectedThread> getMonitored() { List<RejectedThread> allRejectedCluster = getRejectedThreadService().getAllRejectedCluster(); allRejectedCluster.sort(this::compareRejectedThreadsByCount); return allRejectedCluster; }  }
RejectedThreadMonitor extends AbstractMonitor<RejectedThread> { @Override protected List<RejectedThread> getMonitored() { List<RejectedThread> allRejectedCluster = getRejectedThreadService().getAllRejectedCluster(); allRejectedCluster.sort(this::compareRejectedThreadsByCount); return allRejectedCluster; }  @Override String getIdentifier(); @Override String getTriggerExpression(); @Override Class<?> getEvaluatorType(RejectedThread rejectedThread); @Override EvaluatorContext getContext(RejectedThread rejectedThread); }
RejectedThreadMonitor extends AbstractMonitor<RejectedThread> { @Override protected List<RejectedThread> getMonitored() { List<RejectedThread> allRejectedCluster = getRejectedThreadService().getAllRejectedCluster(); allRejectedCluster.sort(this::compareRejectedThreadsByCount); return allRejectedCluster; }  @Override String getIdentifier(); @Override String getTriggerExpression(); @Override Class<?> getEvaluatorType(RejectedThread rejectedThread); @Override EvaluatorContext getContext(RejectedThread rejectedThread);  }