Remove duplication in TestReceivingMSParserTests
Polishing for code style and author name
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -34,41 +34,45 @@ import org.springframework.integration.twitter.inbound.TimelineReceivingMessageS
|
||||
* @author Oleg Zhurakousky
|
||||
* @author Gunnar Hillert
|
||||
* @author Gary Russell
|
||||
* @author Rijnard van Tonder
|
||||
*/
|
||||
public class TestReceivingMessageSourceParserTests {
|
||||
|
||||
@Test
|
||||
public void testReceivingAdapterConfigurationAutoStartup(){
|
||||
public void testReceivingAdapterConfigurationAutoStartup() {
|
||||
ConfigurableApplicationContext ac = new ClassPathXmlApplicationContext(
|
||||
"TestReceivingMessageSourceParser-context.xml", this.getClass());
|
||||
"TestReceivingMessageSourceParser-context.xml", getClass());
|
||||
SourcePollingChannelAdapter spca = ac.getBean("mentionAdapter", SourcePollingChannelAdapter.class);
|
||||
MentionsReceivingMessageSource ms = TestUtils.getPropertyValue(spca, "source", MentionsReceivingMessageSource.class);
|
||||
MentionsReceivingMessageSource ms = TestUtils.getPropertyValue(spca, "source",
|
||||
MentionsReceivingMessageSource.class);
|
||||
assertEquals(Integer.valueOf(23), TestUtils.getPropertyValue(ms, "pageSize", Integer.class));
|
||||
assertNotNull(ms);
|
||||
|
||||
spca = ac.getBean("dmAdapter", SourcePollingChannelAdapter.class);
|
||||
DirectMessageReceivingMessageSource dms = TestUtils.getPropertyValue(spca, "source", DirectMessageReceivingMessageSource.class);
|
||||
DirectMessageReceivingMessageSource dms = TestUtils.getPropertyValue(spca, "source",
|
||||
DirectMessageReceivingMessageSource.class);
|
||||
assertNotNull(dms);
|
||||
assertEquals(Integer.valueOf(45), TestUtils.getPropertyValue(dms, "pageSize", Integer.class));
|
||||
|
||||
spca = ac.getBean("updateAdapter", SourcePollingChannelAdapter.class);
|
||||
|
||||
spca = ac.getBean("updateAdapter", SourcePollingChannelAdapter.class);
|
||||
TimelineReceivingMessageSource tms = TestUtils.getPropertyValue(spca, "source", TimelineReceivingMessageSource.class);
|
||||
TimelineReceivingMessageSource tms = TestUtils.getPropertyValue(spca, "source",
|
||||
TimelineReceivingMessageSource.class);
|
||||
assertEquals(Integer.valueOf(67), TestUtils.getPropertyValue(tms, "pageSize", Integer.class));
|
||||
assertNotNull(tms);
|
||||
ac.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testThatMessageSourcesAreRegisteredAsBeans(){
|
||||
public void testThatMessageSourcesAreRegisteredAsBeans() {
|
||||
ConfigurableApplicationContext ac = new ClassPathXmlApplicationContext(
|
||||
"TestReceivingMessageSourceParser-context.xml", this.getClass());
|
||||
|
||||
MentionsReceivingMessageSource ms = ac.getBean("mentionAdapter.source", MentionsReceivingMessageSource.class);
|
||||
assertNotNull(ms);
|
||||
|
||||
DirectMessageReceivingMessageSource dms = ac.getBean("dmAdapter.source", DirectMessageReceivingMessageSource.class);
|
||||
DirectMessageReceivingMessageSource dms = ac.getBean("dmAdapter.source",
|
||||
DirectMessageReceivingMessageSource.class);
|
||||
assertNotNull(dms);
|
||||
|
||||
TimelineReceivingMessageSource tms = ac.getBean("updateAdapter.source", TimelineReceivingMessageSource.class);
|
||||
|
||||
Reference in New Issue
Block a user