Search in sources :

Example 1 with FeedEntryMessageSource

use of org.springframework.integration.feed.inbound.FeedEntryMessageSource in project spring-integration by spring-projects.

the class FeedInboundChannelAdapterParserTests method validateSuccessfulHttpConfigurationWithCustomMetadataStore.

@Test
public void validateSuccessfulHttpConfigurationWithCustomMetadataStore() {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("FeedInboundChannelAdapterParserTests-http-context.xml", this.getClass());
    SourcePollingChannelAdapter adapter = context.getBean("feedAdapter", SourcePollingChannelAdapter.class);
    FeedEntryMessageSource source = (FeedEntryMessageSource) TestUtils.getPropertyValue(adapter, "source");
    assertNotNull(TestUtils.getPropertyValue(source, "metadataStore"));
    context.close();
}
Also used : FeedEntryMessageSource(org.springframework.integration.feed.inbound.FeedEntryMessageSource) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) SourcePollingChannelAdapter(org.springframework.integration.endpoint.SourcePollingChannelAdapter) Test(org.junit.Test)

Example 2 with FeedEntryMessageSource

use of org.springframework.integration.feed.inbound.FeedEntryMessageSource in project spring-integration by spring-projects.

the class FeedInboundChannelAdapterParserTests method validateSuccessfulFileConfigurationWithCustomMetadataStore.

@Test
public void validateSuccessfulFileConfigurationWithCustomMetadataStore() {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("FeedInboundChannelAdapterParserTests-file-context.xml", this.getClass());
    SourcePollingChannelAdapter adapter = context.getBean("feedAdapter", SourcePollingChannelAdapter.class);
    FeedEntryMessageSource source = (FeedEntryMessageSource) TestUtils.getPropertyValue(adapter, "source");
    assertSame(context.getBean(MetadataStore.class), TestUtils.getPropertyValue(source, "metadataStore"));
    SyndFeedInput syndFeedInput = TestUtils.getPropertyValue(source, "syndFeedInput", SyndFeedInput.class);
    assertSame(context.getBean(SyndFeedInput.class), syndFeedInput);
    assertFalse(syndFeedInput.isPreserveWireFeed());
    context.close();
}
Also used : FeedEntryMessageSource(org.springframework.integration.feed.inbound.FeedEntryMessageSource) MetadataStore(org.springframework.integration.metadata.MetadataStore) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) SyndFeedInput(com.rometools.rome.io.SyndFeedInput) SourcePollingChannelAdapter(org.springframework.integration.endpoint.SourcePollingChannelAdapter) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)2 SourcePollingChannelAdapter (org.springframework.integration.endpoint.SourcePollingChannelAdapter)2 FeedEntryMessageSource (org.springframework.integration.feed.inbound.FeedEntryMessageSource)2 SyndFeedInput (com.rometools.rome.io.SyndFeedInput)1 MetadataStore (org.springframework.integration.metadata.MetadataStore)1