Search in sources :

Example 1 with SearchReceivingMessageSource

use of org.springframework.integration.twitter.inbound.SearchReceivingMessageSource in project spring-integration by spring-projects.

the class TestSearchReceivingMessageSourceParserTests method testSearchReceivingDefaultTemplate.

@Test
public void testSearchReceivingDefaultTemplate() {
    ConfigurableApplicationContext ac = new ClassPathXmlApplicationContext("TestSearchReceivingMessageSourceParser-context.xml", this.getClass());
    SourcePollingChannelAdapter spca = ac.getBean("searchAdapterWithTemplate", SourcePollingChannelAdapter.class);
    SearchReceivingMessageSource ms = (SearchReceivingMessageSource) TestUtils.getPropertyValue(spca, "source");
    assertEquals(Integer.valueOf(23), TestUtils.getPropertyValue(ms, "pageSize", Integer.class));
    Twitter template = (Twitter) TestUtils.getPropertyValue(ms, "twitter");
    assertNotNull(template);
    ac.close();
}
Also used : ConfigurableApplicationContext(org.springframework.context.ConfigurableApplicationContext) SearchReceivingMessageSource(org.springframework.integration.twitter.inbound.SearchReceivingMessageSource) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) SourcePollingChannelAdapter(org.springframework.integration.endpoint.SourcePollingChannelAdapter) Twitter(org.springframework.social.twitter.api.Twitter) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 ConfigurableApplicationContext (org.springframework.context.ConfigurableApplicationContext)1 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)1 SourcePollingChannelAdapter (org.springframework.integration.endpoint.SourcePollingChannelAdapter)1 SearchReceivingMessageSource (org.springframework.integration.twitter.inbound.SearchReceivingMessageSource)1 Twitter (org.springframework.social.twitter.api.Twitter)1