@Test public void testMandatoryPropertiesSet() throws Exception { MessageSourcePollerInterceptor interceptor = new MessageSourcePollerInterceptor(); interceptor.setMessageSource(new TestMessageSource("foo")); interceptor.afterPropertiesSet(); }
@Test(expected = IllegalStateException.class) public void testMandatoryPropertiesUnset() throws Exception { MessageSourcePollerInterceptor interceptor = new MessageSourcePollerInterceptor(); interceptor.afterPropertiesSet(); }
@Test public void testPreReceive() throws Exception { MessageSourcePollerInterceptor interceptor = new MessageSourcePollerInterceptor(new TestMessageSource("foo")); QueueChannel channel = new QueueChannel(); assertTrue(interceptor.preReceive(channel)); assertEquals("foo", channel.receive(10L).getPayload()); }
@Test public void testMandatoryPropertiesSetViaConstructor() throws Exception { MessageSourcePollerInterceptor interceptor = new MessageSourcePollerInterceptor(new TestMessageSource("foo")); interceptor.afterPropertiesSet(); }