@Test public void testDefaultDontSkip() throws Exception { SourcePollingChannelAdapter adapter = new SourcePollingChannelAdapter(); final CountDownLatch latch = new CountDownLatch(1); adapter.setSource(() -> { latch.countDown(); return null; }); adapter.setTrigger(new OnlyOnceTrigger()); configure(adapter); List<Advice> adviceChain = new ArrayList<>(); PollSkipAdvice advice = new PollSkipAdvice(); adviceChain.add(advice); adapter.setAdviceChain(adviceChain); adapter.afterPropertiesSet(); adapter.start(); assertTrue(latch.await(10, TimeUnit.SECONDS)); adapter.stop(); }
SimplePollSkipStrategy skipper = new SimplePollSkipStrategy(); skipper.skipPolls(); PollSkipAdvice advice = new PollSkipAdvice(skipper); adviceChain.add(advice); adapter.setAdviceChain(adviceChain);