INT-1604 encapsulation

This commit is contained in:
Mark Fisher
2010-11-11 17:50:33 -05:00
parent 4f3b887ddd
commit b5f57e3ddc
2 changed files with 11 additions and 9 deletions

View File

@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.twitter.config;
import static junit.framework.Assert.assertFalse;
@@ -20,17 +21,17 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.junit.Test;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.SmartLifecycle;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.endpoint.SourcePollingChannelAdapter;
import org.springframework.integration.test.util.TestUtils;
import org.springframework.integration.twitter.core.TwitterOperations;
import org.springframework.integration.twitter.inbound.AbstractTwitterMessageSource;
/**
* @author Oleg Zhurakousky
*
*/
public class TestReceivingMessageSourceParserTests {
@@ -38,18 +39,19 @@ public class TestReceivingMessageSourceParserTests {
public void testRecievingAdapterConfigurationAutoStartup(){
ApplicationContext ac = new ClassPathXmlApplicationContext("TestReceivingMessageSourceParser-context.xml", this.getClass());
SourcePollingChannelAdapter spca = ac.getBean("mentionAdapter", SourcePollingChannelAdapter.class);
AbstractTwitterMessageSource<?> ms = (AbstractTwitterMessageSource<?>) TestUtils.getPropertyValue(spca, "source");
SmartLifecycle ms = TestUtils.getPropertyValue(spca, "source", SmartLifecycle.class);
assertFalse(ms.isAutoStartup());
spca = ac.getBean("dmAdapter", SourcePollingChannelAdapter.class);
ms = (AbstractTwitterMessageSource<?>) TestUtils.getPropertyValue(spca, "source");
ms = TestUtils.getPropertyValue(spca, "source", SmartLifecycle.class);
assertFalse(ms.isAutoStartup());
spca = ac.getBean("updateAdapter", SourcePollingChannelAdapter.class);
ms = (AbstractTwitterMessageSource<?>) TestUtils.getPropertyValue(spca, "source");
ms = TestUtils.getPropertyValue(spca, "source", SmartLifecycle.class);
assertFalse(ms.isAutoStartup());
}
public static class TwitterTemplateFactoryBean implements FactoryBean<TwitterOperations>{
@Override
@@ -68,6 +70,6 @@ public class TestReceivingMessageSourceParserTests {
public boolean isSingleton() {
return true;
}
}
}