pollForTweets(long sinceId) {
- return this.getTwitter().timelineOperations().getHomeTimeline(this.getPageSize(), sinceId, 0);
- }
-
-}
diff --git a/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/inbound/package-info.java b/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/inbound/package-info.java
deleted file mode 100644
index edf5190547..0000000000
--- a/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/inbound/package-info.java
+++ /dev/null
@@ -1,4 +0,0 @@
-/**
- * Provides inbound Twitter components.
- */
-package org.springframework.integration.twitter.inbound;
diff --git a/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/outbound/DirectMessageSendingMessageHandler.java b/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/outbound/DirectMessageSendingMessageHandler.java
deleted file mode 100644
index 6bfc2e40e8..0000000000
--- a/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/outbound/DirectMessageSendingMessageHandler.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.integration.twitter.outbound;
-
-import org.springframework.integration.handler.AbstractMessageHandler;
-import org.springframework.integration.twitter.core.TwitterHeaders;
-import org.springframework.messaging.Message;
-import org.springframework.social.twitter.api.Twitter;
-import org.springframework.util.Assert;
-
-/**
- * Simple adapter to support sending outbound direct messages ("DM"s) using Twitter.
- *
- * @author Josh Long
- * @author Oleg Zhurakousky
- * @author Mark Fisher
- * @since 2.0
- */
-public class DirectMessageSendingMessageHandler extends AbstractMessageHandler {
-
- private final Twitter twitter;
-
-
- public DirectMessageSendingMessageHandler(Twitter twitter) {
- Assert.notNull(twitter, "twitter must not be null");
- this.twitter = twitter;
- }
-
- @Override
- public String getComponentType() {
- return "twitter:dm-outbound-channel-adapter";
- }
-
- @Override
- protected void handleMessageInternal(Message> message) throws Exception {
- Assert.isTrue(message.getPayload() instanceof String, "Only payload of type String is supported. " +
- "Consider adding a transformer to the message flow in front of this adapter.");
- Object toUser = message.getHeaders().get(TwitterHeaders.DM_TARGET_USER_ID);
- Assert.isTrue(toUser instanceof String || toUser instanceof Number,
- "the header '" + TwitterHeaders.DM_TARGET_USER_ID +
- "' must contain either a String (a screenname) or an number (a user ID)");
- String payload = (String) message.getPayload();
- if (toUser instanceof Number) {
- this.twitter.directMessageOperations().sendDirectMessage(((Number) toUser).longValue(), payload);
- }
- else if (toUser instanceof String) {
- this.twitter.directMessageOperations().sendDirectMessage((String) toUser, payload);
- }
- }
-
-}
diff --git a/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/outbound/StatusUpdatingMessageHandler.java b/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/outbound/StatusUpdatingMessageHandler.java
deleted file mode 100644
index 024d7c8683..0000000000
--- a/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/outbound/StatusUpdatingMessageHandler.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.integration.twitter.outbound;
-
-import org.springframework.expression.EvaluationContext;
-import org.springframework.expression.Expression;
-import org.springframework.expression.TypeLocator;
-import org.springframework.expression.spel.support.StandardTypeLocator;
-import org.springframework.integration.expression.ExpressionUtils;
-import org.springframework.integration.handler.AbstractMessageHandler;
-import org.springframework.messaging.Message;
-import org.springframework.messaging.MessageHandlingException;
-import org.springframework.social.twitter.api.Tweet;
-import org.springframework.social.twitter.api.TweetData;
-import org.springframework.social.twitter.api.Twitter;
-import org.springframework.util.Assert;
-
-/**
- * MessageHandler for sending regular status updates as well as 'replies' or 'mentions'.
- *
- * @author Josh Long
- * @author Oleg Zhurakousky
- * @author Artem Bilan
- * @since 2.0
- */
-public class StatusUpdatingMessageHandler extends AbstractMessageHandler {
-
- private final Twitter twitter;
-
- private volatile Expression tweetDataExpression;
-
- private EvaluationContext evaluationContext;
-
- public StatusUpdatingMessageHandler(Twitter twitter) {
- Assert.notNull(twitter, "twitter must not be null");
- this.twitter = twitter;
- }
-
- @Override
- public String getComponentType() {
- return "twitter:outbound-channel-adapter";
- }
-
- /**
- * An expression that is used to build the {@link TweetData}; must resolve to a
- * {@link TweetData} object, or a {@link String}, or a {@link Tweet}.
- * When using a {@code TweetData} directly in the expression, it is not necessary
- * to include the package:
- * {@code "new TweetData("test").withMedia(headers.mediaResource).displayCoordinates(true)")}.
- * @param tweetDataExpression The expression.
- * @since 4.0
- */
- public void setTweetDataExpression(Expression tweetDataExpression) {
- this.tweetDataExpression = tweetDataExpression;
- }
-
- public void setIntegrationEvaluationContext(EvaluationContext evaluationContext) {
- this.evaluationContext = evaluationContext;
- }
-
- @Override
- protected void onInit() throws Exception {
- super.onInit();
-
- if (this.evaluationContext == null) {
- this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory());
-
- TypeLocator typeLocator = this.evaluationContext.getTypeLocator();
- if (typeLocator instanceof StandardTypeLocator) {
- /*
- * Register the twitter api package so they don't need a FQCN for TweetData.
- */
- ((StandardTypeLocator) typeLocator).registerImport("org.springframework.social.twitter.api");
- }
- }
- }
-
- @Override
- protected void handleMessageInternal(Message> message) throws Exception {
- Object value;
- if (this.tweetDataExpression != null) {
- value = this.tweetDataExpression.getValue(this.evaluationContext, message);
- }
- else {
- value = message.getPayload();
- }
- Assert.notNull(value, "The tweetData cannot evaluate to 'null'.");
-
- TweetData tweetData = null;
-
- if (value instanceof TweetData) {
- tweetData = (TweetData) value;
- }
- else if (value instanceof Tweet) {
- tweetData = new TweetData(((Tweet) value).getText());
- }
- else if (value instanceof String) {
- tweetData = new TweetData((String) value);
- }
- else {
- throw new MessageHandlingException(message, "Unsupported tweetData: " + value);
- }
-
- this.twitter.timelineOperations().updateStatus(tweetData);
- }
-
-}
diff --git a/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/outbound/TwitterSearchOutboundGateway.java b/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/outbound/TwitterSearchOutboundGateway.java
deleted file mode 100644
index 012a1a6053..0000000000
--- a/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/outbound/TwitterSearchOutboundGateway.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright 2014-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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.integration.twitter.outbound;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.springframework.expression.EvaluationContext;
-import org.springframework.expression.Expression;
-import org.springframework.expression.TypeLocator;
-import org.springframework.expression.spel.support.StandardTypeLocator;
-import org.springframework.integration.expression.ExpressionUtils;
-import org.springframework.integration.handler.AbstractReplyProducingMessageHandler;
-import org.springframework.integration.twitter.core.TwitterHeaders;
-import org.springframework.messaging.Message;
-import org.springframework.social.twitter.api.SearchParameters;
-import org.springframework.social.twitter.api.SearchResults;
-import org.springframework.social.twitter.api.Tweet;
-import org.springframework.social.twitter.api.Twitter;
-import org.springframework.util.Assert;
-
-/**
- * The {@link AbstractReplyProducingMessageHandler} implementation to perform request/reply
- * Twitter search with {@link SearchParameters} as the result of {@link #searchArgsExpression}
- * expression evaluation.
- *
- * @author Gary Russell
- * @since 4.0
- */
-public class TwitterSearchOutboundGateway extends AbstractReplyProducingMessageHandler {
-
- private static final int DEFAULT_PAGE_SIZE = 20;
-
- private final Twitter twitter;
-
- private volatile Expression searchArgsExpression;
-
- private volatile EvaluationContext evaluationContext;
-
- public TwitterSearchOutboundGateway(Twitter twitter) {
- Assert.notNull(twitter, "'twitter' must not be null");
- this.twitter = twitter;
- }
-
- /**
- * An expression that is used to build the search; must resolve to a
- * {@code SearchParameters} object, or a
- * {@link String}, in which case the default page size of 20 is applied,
- * or a list of up to 4 arguments, such as
- * {@code "{payload, headers.pageSize, headers.sinceId, headers.maxId}"}.
- * The first (required) argument must resolve to a String (query), the
- * optional arguments must resolve to an Number and represent the
- * page size, sinceId, and maxId respectively. Refer to the 'Spring
- * Social Twitter' documentation for more details.
- *
When using a {@code SearchParameters} directly, it is not necessary
- * to include the package: {@code "new SearchParameters("#foo").count(20)")}.
- *
Default: {@code "payload"}.
- * @param searchArgsExpression The expression.
- */
- public void setSearchArgsExpression(Expression searchArgsExpression) {
- Assert.notNull(searchArgsExpression, "'searchArgsExpression' must not be null");
- this.searchArgsExpression = searchArgsExpression;
- }
-
- public void setIntegrationEvaluationContext(EvaluationContext evaluationContext) {
- this.evaluationContext = evaluationContext;
- }
-
- @Override
- public String getComponentType() {
- return "twitter:search-outbound-gateway";
- }
-
- protected Twitter getTwitter() {
- return this.twitter;
- }
-
- @Override
- protected void doInit() {
- super.doInit();
- if (this.evaluationContext == null) {
- this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory());
- TypeLocator typeLocator = this.evaluationContext.getTypeLocator();
- if (typeLocator instanceof StandardTypeLocator) {
- /*
- * Register the twitter api package so they don't need a FQCN for SearchParameters.
- */
- ((StandardTypeLocator) typeLocator).registerImport("org.springframework.social.twitter.api");
- }
- }
- }
-
- @Override
- protected Object handleRequestMessage(Message> requestMessage) {
- Object args;
- if (this.searchArgsExpression != null) {
- args = this.searchArgsExpression.getValue(this.evaluationContext, requestMessage);
- }
- else {
- args = requestMessage.getPayload();
- }
- Assert.notNull(args, "The twitter search expression cannot evaluate to 'null'.");
- SearchParameters searchParameters;
- if (args instanceof SearchParameters) {
- searchParameters = (SearchParameters) args;
- }
- else if (args instanceof String) {
- searchParameters = new SearchParameters((String) args).count(DEFAULT_PAGE_SIZE);
- }
- else if (args instanceof List) {
- List> list = (List>) args;
- Assert.isTrue(list.size() > 0 && list.size() < 5, "Between 1 and 4 search arguments are required");
- Assert.isInstanceOf(String.class, list.get(0), "The first search argument (query) must be a String");
- searchParameters = new SearchParameters((String) list.get(0));
- if (list.size() > 1) {
- Assert.isInstanceOf(Number.class, list.get(1),
- "The second search argument (pageSize) must be a Number");
- searchParameters.count(((Number) list.get(1)).intValue());
- if (list.size() > 2) {
- Assert.isInstanceOf(Number.class, list.get(2),
- "The third search argument (sinceId) must be a Number");
- searchParameters.sinceId(((Number) list.get(2)).longValue());
- }
- if (list.size() > 3) {
- Assert.isInstanceOf(Number.class, list.get(3),
- "The fourth search argument (maxId) must be a Number");
- searchParameters.maxId(((Number) list.get(3)).longValue());
- }
- }
- }
- else {
- throw new IllegalArgumentException(
- "Search Expression must evaluate to a 'SearchParameters', 'String' or 'List'.");
- }
- SearchResults results = this.getTwitter().searchOperations().search(searchParameters);
- if (results != null) {
- List tweets = (results.getTweets() != null ? results.getTweets() : Collections.emptyList());
- return this.getMessageBuilderFactory().withPayload(tweets)
- .setHeader(TwitterHeaders.SEARCH_METADATA, results.getSearchMetadata());
- }
- else {
- return null;
- }
-
- }
-
-}
diff --git a/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/outbound/package-info.java b/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/outbound/package-info.java
deleted file mode 100644
index d74fdc979f..0000000000
--- a/spring-integration-twitter/src/main/java/org/springframework/integration/twitter/outbound/package-info.java
+++ /dev/null
@@ -1,4 +0,0 @@
-/**
- * Provides outbound Twitter components.
- */
-package org.springframework.integration.twitter.outbound;
diff --git a/spring-integration-twitter/src/main/resources/META-INF/spring.handlers b/spring-integration-twitter/src/main/resources/META-INF/spring.handlers
deleted file mode 100644
index cce51179e9..0000000000
--- a/spring-integration-twitter/src/main/resources/META-INF/spring.handlers
+++ /dev/null
@@ -1,2 +0,0 @@
-http\://www.springframework.org/schema/integration/twitter=org.springframework.integration.twitter.config.TwitterNamespaceHandler
-
diff --git a/spring-integration-twitter/src/main/resources/META-INF/spring.schemas b/spring-integration-twitter/src/main/resources/META-INF/spring.schemas
deleted file mode 100644
index 18cbab5d99..0000000000
--- a/spring-integration-twitter/src/main/resources/META-INF/spring.schemas
+++ /dev/null
@@ -1,2 +0,0 @@
-http\://www.springframework.org/schema/integration/twitter/spring-integration-twitter-5.1.xsd=org/springframework/integration/twitter/config/spring-integration-twitter-5.1.xsd
-http\://www.springframework.org/schema/integration/twitter/spring-integration-twitter.xsd=org/springframework/integration/twitter/config/spring-integration-twitter-5.1.xsd
diff --git a/spring-integration-twitter/src/main/resources/META-INF/spring.tooling b/spring-integration-twitter/src/main/resources/META-INF/spring.tooling
deleted file mode 100644
index b6a771dd57..0000000000
--- a/spring-integration-twitter/src/main/resources/META-INF/spring.tooling
+++ /dev/null
@@ -1,4 +0,0 @@
-# Tooling related information for the integration twitter namespace
-http\://www.springframework.org/schema/integration/twitter@name=integration twitter Namespace
-http\://www.springframework.org/schema/integration/twitter@prefix=int-twitter
-http\://www.springframework.org/schema/integration/twitter@icon=org/springframework/integration/twitter/config/spring-integration-twitter.gif
diff --git a/spring-integration-twitter/src/main/resources/org/springframework/integration/twitter/config/spring-integration-twitter-5.1.xsd b/spring-integration-twitter/src/main/resources/org/springframework/integration/twitter/config/spring-integration-twitter-5.1.xsd
deleted file mode 100644
index cefdaf2a67..0000000000
--- a/spring-integration-twitter/src/main/resources/org/springframework/integration/twitter/config/spring-integration-twitter-5.1.xsd
+++ /dev/null
@@ -1,322 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- Defines a Polling Channel Adapter for the
- 'org.springframework.integration.twitter.inbound.TimelineReceivingMessageSource' that consumes your
- friends' timeline updates from Twitter and sends Messages whose payloads are Tweet objects.
-
-
-
-
-
-
-
-
-
-
-
-
- Defines a Polling Channel Adapter for the
- 'org.springframework.integration.twitter.inbound.MentionsReceivingMessageSource' that consumes mentions
- of your handle from Twitter and sends Messages whose payloads are Tweet objects.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Defines a Polling Channel Adapter for the
- 'org.springframework.integration.twitter.inbound.SearchReceivingMessageSource' that consumes search
- results for a given query from Twitter and sends Messages whose payloads are Tweet objects.
-
-
-
-
-
-
-
-
- Twitter search query (e.g, #springintegration).
- For more info on Twitter queries please refer to this site: http://search.twitter.com/operators)
-
-
-
-
-
-
-
-
-
-
-
- Defines a Polling Channel Adapter for the
- 'org.springframework.integration.twitter.inbound.DirectMessageReceivingMessageSource' that consumes
- direct messages from Twitter and sends Messages whose payloads are DirectMessage objects.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Configures a Consumer Endpoint for the
- 'org.springframework.integration.twitter.outbound.DirectMessageSendingMessageHandler'
- that sends Direct Messages to a Twitter user as
- specified in the header whose name is defined by the TwitterHeaders.DM_TARGET_USER_ID constant.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Configures a Consumer Endpoint for the
- 'org.springframework.integration.twitter.outbound.StatusUpdatingMessageHandler'
- that posts a status update to the authorized user's timeline.
-
-
-
-
-
-
-
-
- A SpEL expression that evaluates to tweetData; the evaluation result type can be
- an 'org.springframework.social.twitter.api.TweetData', a 'String' or
- 'org.springframework.social.twitter.api.Tweet'.
- Default: "payload".
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The bean id of this gateway; the MessageHandler is also registered with this id
- plus a suffix '.handler'.
-
-
-
-
-
-
- A SpEL expression that evaluates to search arguments; the evaluation result type can be
- an 'org.springframework.social.twitter.api.SearchParameters', a 'String', in
- which case the default page size of 20 is used, or the expression can evaluate to
- a list of search
- arguments, for example: "{payload, headers.pageSize, headers.sinceId, headers.maxId}".
- Default: "payload".
-
-
-
-
-
-
-
-
-
-
-
- Identifies the request channel attached to this gateway.
-
-
-
-
-
-
-
-
-
-
-
- Identifies the reply channel attached to this
- gateway.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The bean id of this Polling Endpoint; the MessageSource is also registered with this id
- plus a suffix '.source'; also used as the
- MetaDataStore key with suffix '.' + the profileId from the authorized Twitter user.
-
-
-
-
-
-
-
-
-
-
-
- Identifies the channel the attached to this adapter, to which messages will be sent.
-
-
-
-
-
-
-
-
-
-
-
-
- Reference to a TwitterTemplate bean provided by the Spring Social project.
-
-
-
-
-
-
- Reference to a MetadataStore instance for storing metadata associated with
- the retrieved feeds. If the implementation is persistent, it can help to
- prevent duplicates between restarts. If shared, it can help coordinate multiple
- instances of an adapter across different processes.
-
-
-
-
-
-
-
-
-
-
-
- Limits the number of tweets retrieved on each poll; default: 20.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Reference to a TwitterTemplate bean provided by the Spring Social project.
-
-
-
-
-
-
- Specifies the order for invocation when this endpoint is connected as a
- subscriber to a SubscribableChannel.
-
-
-
-
-
-
diff --git a/spring-integration-twitter/src/main/resources/org/springframework/integration/twitter/config/spring-integration-twitter.gif b/spring-integration-twitter/src/main/resources/org/springframework/integration/twitter/config/spring-integration-twitter.gif
deleted file mode 100644
index 2499ccde28..0000000000
Binary files a/spring-integration-twitter/src/main/resources/org/springframework/integration/twitter/config/spring-integration-twitter.gif and /dev/null differ
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/OutboundAdapterWithRHACWithinChain-fail-context.xml b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/OutboundAdapterWithRHACWithinChain-fail-context.xml
deleted file mode 100644
index 94eea09851..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/OutboundAdapterWithRHACWithinChain-fail-context.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestReceivingMessageSourceParser-context.xml b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestReceivingMessageSourceParser-context.xml
deleted file mode 100644
index d6d2134ae3..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestReceivingMessageSourceParser-context.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestReceivingMessageSourceParserTests.java b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestReceivingMessageSourceParserTests.java
deleted file mode 100644
index 412b9a45ee..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestReceivingMessageSourceParserTests.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.integration.twitter.config;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import org.junit.Test;
-
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-import org.springframework.integration.endpoint.SourcePollingChannelAdapter;
-import org.springframework.integration.test.util.TestUtils;
-import org.springframework.integration.twitter.inbound.DirectMessageReceivingMessageSource;
-import org.springframework.integration.twitter.inbound.MentionsReceivingMessageSource;
-import org.springframework.integration.twitter.inbound.TimelineReceivingMessageSource;
-
-
-/**
- * @author Oleg Zhurakousky
- * @author Gunnar Hillert
- * @author Gary Russell
- * @author Rijnard van Tonder
- */
-public class TestReceivingMessageSourceParserTests {
-
- @Test
- public void testReceivingAdapterConfigurationAutoStartup() {
- ConfigurableApplicationContext ac = new ClassPathXmlApplicationContext(
- "TestReceivingMessageSourceParser-context.xml", getClass());
- SourcePollingChannelAdapter spca = ac.getBean("mentionAdapter", SourcePollingChannelAdapter.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);
- assertNotNull(dms);
- assertEquals(Integer.valueOf(45), TestUtils.getPropertyValue(dms, "pageSize", Integer.class));
-
- spca = ac.getBean("updateAdapter", SourcePollingChannelAdapter.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() {
- 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);
- assertNotNull(dms);
-
- TimelineReceivingMessageSource tms = ac.getBean("updateAdapter.source", TimelineReceivingMessageSource.class);
- assertNotNull(tms);
- ac.close();
- }
-
-}
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestSearchReceivingMessageSourceParser-context.xml b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestSearchReceivingMessageSourceParser-context.xml
deleted file mode 100644
index 9c79a93d05..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestSearchReceivingMessageSourceParser-context.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestSearchReceivingMessageSourceParserTests.java b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestSearchReceivingMessageSourceParserTests.java
deleted file mode 100644
index a7ebd3348f..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestSearchReceivingMessageSourceParserTests.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.integration.twitter.config;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import org.junit.Test;
-
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-import org.springframework.integration.endpoint.SourcePollingChannelAdapter;
-import org.springframework.integration.test.util.TestUtils;
-import org.springframework.integration.twitter.inbound.SearchReceivingMessageSource;
-import org.springframework.social.twitter.api.Twitter;
-
-
-/**
- * @author Oleg Zhurakousky
- * @author Gary Russell
- */
-public class TestSearchReceivingMessageSourceParserTests {
-
- @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();
- }
-}
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestSendingMessageHandlerParser-context.xml b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestSendingMessageHandlerParser-context.xml
deleted file mode 100644
index 675858e7dd..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestSendingMessageHandlerParser-context.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestSendingMessageHandlerParserTests.java b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestSendingMessageHandlerParserTests.java
deleted file mode 100644
index 5a6d4c262c..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestSendingMessageHandlerParserTests.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.integration.twitter.config;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.junit.Test;
-
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-import org.springframework.integration.endpoint.EventDrivenConsumer;
-import org.springframework.integration.handler.advice.AbstractRequestHandlerAdvice;
-import org.springframework.integration.test.util.TestUtils;
-import org.springframework.integration.twitter.outbound.DirectMessageSendingMessageHandler;
-import org.springframework.messaging.Message;
-import org.springframework.messaging.MessageHandler;
-import org.springframework.messaging.support.GenericMessage;
-
-/**
- * @author Oleg Zhurakousky
- * @author Gary Russell
- * @author Artem Bilan
- * @author Gary Russell
- * @since 2.0
- */
-public class TestSendingMessageHandlerParserTests {
-
- private static volatile int adviceCalled;
-
- @Test
- public void testSendingMessageHandlerSuccessfulBootstrap() {
- ConfigurableApplicationContext ac = new ClassPathXmlApplicationContext(
- "TestSendingMessageHandlerParser-context.xml", this.getClass());
- EventDrivenConsumer dmAdapter = ac.getBean("dmAdapter", EventDrivenConsumer.class);
- MessageHandler handler = TestUtils.getPropertyValue(dmAdapter, "handler", MessageHandler.class);
- assertEquals(DirectMessageSendingMessageHandler.class, handler.getClass());
- assertEquals(23, TestUtils.getPropertyValue(handler, "order"));
- dmAdapter = ac.getBean("dmAdvised", EventDrivenConsumer.class);
- handler = TestUtils.getPropertyValue(dmAdapter, "handler", MessageHandler.class);
- handler.handleMessage(new GenericMessage("foo"));
- assertEquals(1, adviceCalled);
- MessageHandler handler2 = TestUtils.getPropertyValue(ac.getBean("advised"), "handler", MessageHandler.class);
- assertNotSame(handler, handler2);
- handler2.handleMessage(new GenericMessage("foo"));
- assertEquals(2, adviceCalled);
- ac.close();
- }
-
- @Test
- public void testInt2718FailForOutboundAdapterWithRequestHandlerAdviceChainWithinChainConfig() {
- try {
- new ClassPathXmlApplicationContext("OutboundAdapterWithRHACWithinChain-fail-context.xml", this.getClass())
- .close();
- fail("Expected BeanDefinitionParsingException");
- }
- catch (BeansException e) {
- assertTrue(e instanceof BeanDefinitionParsingException);
- assertTrue(e.getMessage().contains("'request-handler-advice-chain' isn't allowed " +
- "for 'twitter:outbound-channel-adapter' within a , because its Handler isn't an AbstractReplyProducingMessageHandler"));
- }
- }
-
-
- public static class FooAdvice extends AbstractRequestHandlerAdvice {
-
- @Override
- protected Object doInvoke(ExecutionCallback callback, Object target, Message> message) throws Exception {
- adviceCalled++;
- return null;
- }
-
- }
-}
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TwitterSearchOutboundGatewayParserTests-context.xml b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TwitterSearchOutboundGatewayParserTests-context.xml
deleted file mode 100644
index 6c4d15a455..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TwitterSearchOutboundGatewayParserTests-context.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TwitterSearchOutboundGatewayParserTests.java b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TwitterSearchOutboundGatewayParserTests.java
deleted file mode 100644
index 99aa3272c5..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TwitterSearchOutboundGatewayParserTests.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2014-2018 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.integration.twitter.config;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertThat;
-
-import java.util.List;
-
-import org.hamcrest.Matchers;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.integration.endpoint.PollingConsumer;
-import org.springframework.integration.handler.advice.RequestHandlerRetryAdvice;
-import org.springframework.integration.test.util.TestUtils;
-import org.springframework.integration.twitter.outbound.TwitterSearchOutboundGateway;
-import org.springframework.social.twitter.api.Twitter;
-import org.springframework.test.annotation.DirtiesContext;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-/**
- * @author Gary Russell
- * @author Artem Bilan
- *
- * @since 4.0
- *
- */
-@ContextConfiguration
-@RunWith(SpringJUnit4ClassRunner.class)
-@DirtiesContext
-public class TwitterSearchOutboundGatewayParserTests {
-
- @Autowired
- @Qualifier("defaultTSOG.handler")
- private TwitterSearchOutboundGateway defaultTSOG;
-
- @Autowired
- @Qualifier("allAttsTSOG.handler")
- private TwitterSearchOutboundGateway allAttsTSOG;
-
- @Autowired
- private PollingConsumer polledAndAdvisedTSOG;
-
- @Autowired
- private Twitter twitter;
-
- @Test
- public void testDefault() {
- assertSame(twitter, TestUtils.getPropertyValue(defaultTSOG, "twitter"));
- }
-
- @Test
- public void testAllAtts() {
- assertSame(twitter, TestUtils.getPropertyValue(allAttsTSOG, "twitter"));
- assertEquals("'foo'", TestUtils.getPropertyValue(allAttsTSOG, "searchArgsExpression.expression"));
- }
-
- @Test
- public void testAdvised() {
- assertSame(twitter, TestUtils.getPropertyValue(polledAndAdvisedTSOG, "handler.twitter"));
- assertThat(TestUtils.getPropertyValue(polledAndAdvisedTSOG, "handler.adviceChain", List.class).get(0),
- Matchers.instanceOf(RequestHandlerRetryAdvice.class));
- }
-
-}
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestReceivingUsingNamespace-context.xml b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestReceivingUsingNamespace-context.xml
deleted file mode 100644
index a415a48789..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestReceivingUsingNamespace-context.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestReceivingUsingNamespace.java b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestReceivingUsingNamespace.java
deleted file mode 100644
index 4bb221d1c8..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestReceivingUsingNamespace.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.integration.twitter.ignored;
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import org.junit.Ignore;
-import org.junit.Test;
-
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-/**
- * @author Oleg Zhurakousky
- * @author Gary Russell
- *
- */
-public class TestReceivingUsingNamespace {
-
- @Test
- @Ignore
- /*
- * In order to run this test you need to provide oauth properties in sample.properties on the classpath.
- */
- public void testUpdatesWithRealTwitter() throws Exception {
- CountDownLatch latch = new CountDownLatch(1);
- ConfigurableApplicationContext ctx =
- new ClassPathXmlApplicationContext("TestReceivingUsingNamespace-context.xml", this.getClass());
- latch.await(10000, TimeUnit.SECONDS);
- ctx.close();
- }
-}
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestSearchOutboundGateway-context.xml b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestSearchOutboundGateway-context.xml
deleted file mode 100644
index 40e3678d84..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestSearchOutboundGateway-context.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestSearchOutboundGateway.java b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestSearchOutboundGateway.java
deleted file mode 100644
index 763aacff59..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestSearchOutboundGateway.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2014-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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.integration.twitter.ignored;
-
-import org.junit.Ignore;
-import org.junit.Test;
-
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-import org.springframework.messaging.MessageChannel;
-import org.springframework.messaging.support.GenericMessage;
-import org.springframework.social.twitter.api.SearchParameters;
-
-/**
- * @author Gary Russell
- *
- * @since 4.0
- *
- */
-public class TestSearchOutboundGateway {
-
- @Test
- @Ignore
- /*
- * In order to run this test you need to provide oauth properties in sample.properties on the classpath.
- */
- public void testSearch() throws Exception {
- ConfigurableApplicationContext ctx =
- new ClassPathXmlApplicationContext("TestSearchOutboundGateway-context.xml", this.getClass());
- MessageChannel search = ctx.getBean("search", MessageChannel.class);
- search.send(new GenericMessage("#springintegration"));
- Thread.sleep(10000);
- search.send(new GenericMessage(new SearchParameters("#springintegration").count(5)));
- Thread.sleep(10000);
- search.send(new GenericMessage(new SearchParameters("#jjjjunk").count(5)));
- Thread.sleep(10000);
- ctx.close();
- }
-}
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestSendingDMsUsingNamespace-context.xml b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestSendingDMsUsingNamespace-context.xml
deleted file mode 100644
index 95b36add49..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestSendingDMsUsingNamespace-context.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestSendingDMsUsingNamespace.java b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestSendingDMsUsingNamespace.java
deleted file mode 100644
index 148e44148e..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestSendingDMsUsingNamespace.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2002-2012 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.integration.twitter.ignored;
-
-import org.junit.Ignore;
-import org.junit.Test;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.integration.support.MessageBuilder;
-import org.springframework.integration.twitter.core.TwitterHeaders;
-import org.springframework.messaging.MessageChannel;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
-import org.springframework.util.StringUtils;
-
-/**
- * @author Josh Long
- * @author Oleg Zhurakouksy
- * @author Artem Bilan
- */
-@ContextConfiguration
-public class TestSendingDMsUsingNamespace extends AbstractJUnit4SpringContextTests {
-
- @Autowired
- @Qualifier("inputChannel")
-
- private MessageChannel inputChannel;
-
- @Autowired
- @Qualifier("dmOutboundWithinChain")
- private MessageChannel dmOutboundWithinChain;
-
- @Test
- @Ignore
- public void testSendigRealDirectMessage() throws Throwable {
- String dmUsr = "z_oleg";
- MessageBuilder mb = MessageBuilder.withPayload("'Hello world!', from the Spring Integration outbound Twitter adapter "
- + System.currentTimeMillis());
-
- if (StringUtils.hasText(dmUsr)) {
- mb.setHeader(TwitterHeaders.DM_TARGET_USER_ID, dmUsr);
- }
- inputChannel.send(mb.build());
- }
-
- @Test
- @Ignore
- public void testSendigDirectMessageFromChain() throws Throwable {
- String dmUsr = "z_oleg";
- MessageBuilder mb = MessageBuilder.withPayload("Hello world!");
-
- if (StringUtils.hasText(dmUsr)) {
- mb.setHeader(TwitterHeaders.DM_TARGET_USER_ID, dmUsr);
- }
- dmOutboundWithinChain.send(mb.build());
- }
-
-}
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestSendingUpdatesUsingNamespace-context.xml b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestSendingUpdatesUsingNamespace-context.xml
deleted file mode 100644
index 59fad82833..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestSendingUpdatesUsingNamespace-context.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestSendingUpdatesUsingNamespace.java b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestSendingUpdatesUsingNamespace.java
deleted file mode 100644
index 8f9f079112..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TestSendingUpdatesUsingNamespace.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2002-2017 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.integration.twitter.ignored;
-
-import java.util.Date;
-
-import org.junit.Ignore;
-import org.junit.Test;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.integration.core.MessagingTemplate;
-import org.springframework.integration.support.MessageBuilder;
-import org.springframework.messaging.Message;
-import org.springframework.messaging.MessageChannel;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
-
-/**
- * @author Josh Long
- * @author Artem Bilan
- */
-@ContextConfiguration
-public class TestSendingUpdatesUsingNamespace extends AbstractJUnit4SpringContextTests {
-
- private MessagingTemplate messagingTemplate = new MessagingTemplate();
-
- @Value("#{out}")
- private MessageChannel channel;
-
- @Autowired
- @Qualifier("outFromChain")
- private MessageChannel outFromChain;
-
- @Test
- @Ignore
- public void testSendingATweet() throws Throwable {
- MessageBuilder mb = MessageBuilder.withPayload("Early start today"
- + new Date(System.currentTimeMillis()));
- Message m = mb.build();
- this.messagingTemplate.send(this.channel, m);
- }
-
- @Test
- @Ignore
- public void testSendingATweetFromChain() throws Throwable {
- Message m = MessageBuilder.withPayload("Early start today" + new Date(System.currentTimeMillis())).build();
- this.outFromChain.send(m);
- }
-
-}
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TwitterAnnouncer.java b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TwitterAnnouncer.java
deleted file mode 100644
index 549ac191e7..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/ignored/TwitterAnnouncer.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2002-2014 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.integration.twitter.ignored;
-
-import java.util.Collection;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.springframework.integration.history.MessageHistory;
-import org.springframework.messaging.Message;
-import org.springframework.social.twitter.api.DirectMessage;
-import org.springframework.social.twitter.api.Tweet;
-import org.springframework.stereotype.Component;
-
-/**
- * @author Oleg Zhurakousky
- * @author Mark Fisher
- * @author Gary Russell
- *
- */
-@Component
-public class TwitterAnnouncer {
-
- private final Log logger = LogFactory.getLog(getClass());
-
- public void dm(DirectMessage directMessage) {
- logger.info("A direct message has been received from " +
- directMessage.getSender().getScreenName() + " with text " + directMessage.getText());
- }
-
- public void search(Message> search) {
- MessageHistory history = MessageHistory.read(search);
- Tweet tweet = (Tweet) search.getPayload();
- logger.info("A search item was received " +
- tweet.getCreatedAt() + " with text " + tweet.getText());
- }
-
- public void mention(Tweet s) {
- logger.info("A tweet mentioning (or replying) to you was received having text "
- + s.getFromUser() + "-" + s.getText() + " from " + s.getSource());
- }
-
- public void searchResult(Collection tweets) {
- if (tweets.size() == 0) {
- logger.info("No results");
- }
- for (Tweet s : tweets) {
- logger.info("Search result: "
- + s.getFromUser() + "-" + s.getText() + " from " + s.getSource());
- }
- }
-
- public void updates(Tweet t) {
- logger.info("Received timeline update: " + t.getText() + " from " + t.getSource());
- }
-
-}
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/inbound/DirectMessageReceivingMessageSourceTests.java b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/inbound/DirectMessageReceivingMessageSourceTests.java
deleted file mode 100644
index 903dc28ed9..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/inbound/DirectMessageReceivingMessageSourceTests.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.integration.twitter.inbound;
-
-import java.util.Properties;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import org.springframework.beans.factory.config.PropertiesFactoryBean;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.messaging.Message;
-import org.springframework.social.twitter.api.DirectMessage;
-import org.springframework.social.twitter.api.impl.TwitterTemplate;
-
-/**
- * @author Oleg Zhurakousky
- * @author Gary Russell
- */
-public class DirectMessageReceivingMessageSourceTests {
-
- private final Log logger = LogFactory.getLog(getClass());
-
- @SuppressWarnings("unchecked")
- @Test
- @Ignore
- public void demoReceiveDm() throws Exception {
- PropertiesFactoryBean pf = new PropertiesFactoryBean();
- pf.setLocation(new ClassPathResource("sample.properties"));
- pf.afterPropertiesSet();
- Properties prop = pf.getObject();
- TwitterTemplate template = new TwitterTemplate(prop.getProperty("z_oleg.oauth.consumerKey"),
- prop.getProperty("z_oleg.oauth.consumerSecret"),
- prop.getProperty("z_oleg.oauth.accessToken"),
- prop.getProperty("z_oleg.oauth.accessTokenSecret"));
- DirectMessageReceivingMessageSource tSource = new DirectMessageReceivingMessageSource(template, "foo");
- tSource.afterPropertiesSet();
- for (int i = 0; i < 50; i++) {
- Message message = (Message) tSource.receive();
- if (message != null) {
- DirectMessage tweet = message.getPayload();
- logger.info(tweet.getSender().getScreenName() + " - " + tweet.getText() + " - " + tweet.getCreatedAt());
- }
- }
- }
-
-}
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/inbound/SearchReceivingMessageSourceTests.java b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/inbound/SearchReceivingMessageSourceTests.java
deleted file mode 100644
index d16e2a8c80..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/inbound/SearchReceivingMessageSourceTests.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.integration.twitter.inbound;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import org.springframework.beans.factory.BeanFactory;
-import org.springframework.beans.factory.config.PropertiesFactoryBean;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.integration.metadata.SimpleMetadataStore;
-import org.springframework.integration.test.util.TestUtils;
-import org.springframework.messaging.Message;
-import org.springframework.social.twitter.api.SearchMetadata;
-import org.springframework.social.twitter.api.SearchOperations;
-import org.springframework.social.twitter.api.SearchParameters;
-import org.springframework.social.twitter.api.SearchResults;
-import org.springframework.social.twitter.api.Tweet;
-import org.springframework.social.twitter.api.Twitter;
-import org.springframework.social.twitter.api.impl.TwitterTemplate;
-
-
-/**
- * @author Oleg Zhurakousky
- * @author Gunnar Hillert
- * @author Gary Russell
- */
-public class SearchReceivingMessageSourceTests {
-
- private final Log logger = LogFactory.getLog(getClass());
-
- private static final String SEARCH_QUERY = "#springsource";
-
- @SuppressWarnings("unchecked")
- @Test
- @Ignore
- public void demoReceiveSearchResults() throws Exception {
- PropertiesFactoryBean pf = new PropertiesFactoryBean();
- pf.setLocation(new ClassPathResource("sample.properties"));
- pf.afterPropertiesSet();
- Properties prop = pf.getObject();
- TwitterTemplate template = new TwitterTemplate(prop.getProperty("z_oleg.oauth.consumerKey"),
- prop.getProperty("z_oleg.oauth.consumerSecret"),
- prop.getProperty("z_oleg.oauth.accessToken"),
- prop.getProperty("z_oleg.oauth.accessTokenSecret"));
- SearchReceivingMessageSource tSource = new SearchReceivingMessageSource(template, "foo");
- tSource.setQuery(SEARCH_QUERY);
- tSource.afterPropertiesSet();
- for (int i = 0; i < 50; i++) {
- Message message = (Message) tSource.receive();
- if (message != null) {
- Tweet tweet = message.getPayload();
- logger.info(tweet.getFromUser() + " - " + tweet.getText() + " - " + tweet.getCreatedAt());
- }
- }
- }
-
- /**
- * Unit Test ensuring some basic initialization properties being set.
- */
- @Test
- public void testSearchReceivingMessageSourceInit() {
-
- final SearchReceivingMessageSource messageSource =
- new SearchReceivingMessageSource(new TwitterTemplate("test"), "foo");
- messageSource.setComponentName("twitterSearchMessageSource");
-
- final Object metadataStore = TestUtils.getPropertyValue(messageSource, "metadataStore");
- final Object metadataKey = TestUtils.getPropertyValue(messageSource, "metadataKey");
-
- assertNull(metadataStore);
- assertNotNull(metadataKey);
-
- messageSource.setBeanFactory(mock(BeanFactory.class));
- messageSource.afterPropertiesSet();
-
- final Object metadataStoreInitialized = TestUtils.getPropertyValue(messageSource, "metadataStore");
- final Object metadataKeyInitialized = TestUtils.getPropertyValue(messageSource, "metadataKey");
-
- assertNotNull(metadataStoreInitialized);
- assertTrue(metadataStoreInitialized instanceof SimpleMetadataStore);
- assertNotNull(metadataKeyInitialized);
- assertEquals("foo", metadataKeyInitialized);
-
- final Twitter twitter = TestUtils.getPropertyValue(messageSource, "twitter", Twitter.class);
-
- assertFalse(twitter.isAuthorized());
- assertNotNull(twitter.userOperations());
-
- }
-
- /**
- * This test ensures that when polling for a list of Tweets null is never returned.
- * In case of no polling results, an empty list is returned instead.
- */
- @Test
- public void testPollForTweetsNullResults() {
-
- final TwitterTemplate twitterTemplate = mock(TwitterTemplate.class);
- final SearchOperations so = mock(SearchOperations.class);
-
- when(twitterTemplate.searchOperations()).thenReturn(so);
- when(twitterTemplate.searchOperations().search(SEARCH_QUERY, 20, 0, 0)).thenReturn(null);
-
- final SearchReceivingMessageSource messageSource = new SearchReceivingMessageSource(twitterTemplate, "foo");
- messageSource.setQuery(SEARCH_QUERY);
-
- final String setQuery = TestUtils.getPropertyValue(messageSource, "query", String.class);
-
- assertEquals(SEARCH_QUERY, setQuery);
- assertEquals("twitter:search-inbound-channel-adapter", messageSource.getComponentType());
-
- final List tweets = messageSource.pollForTweets(0);
-
- assertNotNull(tweets);
- assertTrue(tweets.isEmpty());
- }
-
- /**
- * Verify that a polling operation returns in fact 3 results.
- */
- @Test
- public void testPollForTweetsThreeResults() {
-
- final TwitterTemplate twitterTemplate;
-
- final SearchOperations so = mock(SearchOperations.class);
-
- final List tweets = new ArrayList();
-
- tweets.add(mock(Tweet.class));
- tweets.add(mock(Tweet.class));
- tweets.add(mock(Tweet.class));
-
- final SearchResults results = new SearchResults(tweets, new SearchMetadata(111, 111));
-
- twitterTemplate = mock(TwitterTemplate.class);
-
- when(twitterTemplate.searchOperations()).thenReturn(so);
- SearchParameters params = new SearchParameters(SEARCH_QUERY).count(20).sinceId(0);
- when(twitterTemplate.searchOperations().search(params)).thenReturn(results);
-
- final SearchReceivingMessageSource messageSource = new SearchReceivingMessageSource(twitterTemplate, "foo");
-
- messageSource.setQuery(SEARCH_QUERY);
-
- final List tweetSearchResults = messageSource.pollForTweets(0);
-
- assertNotNull(tweetSearchResults);
- assertEquals(3, tweetSearchResults.size());
- }
-
-}
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/inbound/SearchReceivingMessageSourceWithRedisTests-context.xml b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/inbound/SearchReceivingMessageSourceWithRedisTests-context.xml
deleted file mode 100644
index 6ea4b3e3e6..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/inbound/SearchReceivingMessageSourceWithRedisTests-context.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/inbound/SearchReceivingMessageSourceWithRedisTests.java b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/inbound/SearchReceivingMessageSourceWithRedisTests.java
deleted file mode 100644
index 54c3184806..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/inbound/SearchReceivingMessageSourceWithRedisTests.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright 2013-2018 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.integration.twitter.inbound;
-
-import static org.hamcrest.Matchers.instanceOf;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.BDDMockito.given;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.util.ArrayList;
-import java.util.GregorianCalendar;
-import java.util.List;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.integration.endpoint.SourcePollingChannelAdapter;
-import org.springframework.integration.metadata.MetadataStore;
-import org.springframework.integration.redis.metadata.RedisMetadataStore;
-import org.springframework.integration.redis.rules.RedisAvailable;
-import org.springframework.integration.redis.rules.RedisAvailableTests;
-import org.springframework.integration.test.rule.Log4j2LevelAdjuster;
-import org.springframework.integration.test.util.TestUtils;
-import org.springframework.messaging.Message;
-import org.springframework.messaging.PollableChannel;
-import org.springframework.social.twitter.api.SearchMetadata;
-import org.springframework.social.twitter.api.SearchOperations;
-import org.springframework.social.twitter.api.SearchParameters;
-import org.springframework.social.twitter.api.SearchResults;
-import org.springframework.social.twitter.api.Tweet;
-import org.springframework.social.twitter.api.UserOperations;
-import org.springframework.social.twitter.api.impl.TwitterTemplate;
-import org.springframework.test.annotation.DirtiesContext;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringRunner;
-
-/**
- * @author Gunnar Hillert
- * @author Artem Bilan
- * @author Gary Russell
- *
- * @since 3.0
- */
-@ContextConfiguration("SearchReceivingMessageSourceWithRedisTests-context.xml")
-@RunWith(SpringRunner.class)
-@DirtiesContext
-public class SearchReceivingMessageSourceWithRedisTests extends RedisAvailableTests {
-
- @Rule
- public Log4j2LevelAdjuster adjuster = Log4j2LevelAdjuster.trace();
-
- @Autowired
- private SourcePollingChannelAdapter twitterSearchAdapter;
-
- @Autowired
- private AbstractTwitterMessageSource> twitterMessageSource;
-
- @Autowired
- private MetadataStore metadataStore;
-
- @Autowired
- @Qualifier("inbound_twitter")
- private PollableChannel tweets;
-
- @Test
- @RedisAvailable
- public void testPollForTweetsThreeResultsWithRedisMetadataStore() throws Exception {
- String metadataKey = TestUtils.getPropertyValue(twitterSearchAdapter, "source.metadataKey", String.class);
-
- // There is need to set a value, not 'remove' and re-init 'twitterMessageSource'
- this.metadataStore.put(metadataKey, "-1");
-
- this.twitterMessageSource.afterPropertiesSet();
-
- MetadataStore metadataStore = TestUtils.getPropertyValue(this.twitterSearchAdapter, "source.metadataStore",
- MetadataStore.class);
- assertTrue("Expected metadataStore to be an instance of RedisMetadataStore",
- metadataStore instanceof RedisMetadataStore);
- assertSame(this.metadataStore, metadataStore);
-
- assertEquals("twitterSearchAdapter.74", metadataKey);
-
- this.twitterSearchAdapter.start();
-
- Message> receive = this.tweets.receive(10000);
- assertNotNull(receive);
-
- receive = this.tweets.receive(10000);
- assertNotNull(receive);
-
- receive = this.tweets.receive(10000);
- assertNotNull(receive);
-
- /* We received 3 messages so far. When invoking receive() again the search
- * will return again the 3 test Tweets but as we already processed them
- * no message (null) is returned. */
- assertNull(this.tweets.receive(0));
-
- String persistedMetadataStoreValue = this.metadataStore.get(metadataKey);
- assertNotNull(persistedMetadataStoreValue);
- assertEquals("3", persistedMetadataStoreValue);
-
- this.twitterSearchAdapter.stop();
-
- this.metadataStore.put(metadataKey, "1");
-
- this.twitterMessageSource.afterPropertiesSet();
-
- this.twitterSearchAdapter.start();
-
- receive = this.tweets.receive(10000);
- assertNotNull(receive);
- assertThat(receive.getPayload(), instanceOf(Tweet.class));
- assertEquals(((Tweet) receive.getPayload()).getId(), 2L);
-
- receive = this.tweets.receive(10000);
- assertNotNull(receive);
- assertThat(receive.getPayload(), instanceOf(Tweet.class));
- assertEquals(((Tweet) receive.getPayload()).getId(), 3L);
-
- assertNull(this.tweets.receive(0));
-
- persistedMetadataStoreValue = this.metadataStore.get(metadataKey);
- assertNotNull(persistedMetadataStoreValue);
- assertEquals("3", persistedMetadataStoreValue);
- }
-
- @Configuration
- public static class SearchReceivingMessageSourceWithRedisTestsConfig {
-
- @Bean(name = "twitterTemplate")
- public TwitterTemplate twitterTemplate() {
- TwitterTemplate twitterTemplate = mock(TwitterTemplate.class);
-
- SearchOperations so = mock(SearchOperations.class);
-
- Tweet tweet3 = mock(Tweet.class);
- given(tweet3.getId()).willReturn(3L);
- given(tweet3.getCreatedAt()).willReturn(new GregorianCalendar(2013, 2, 20).getTime());
- given(tweet3.toString()).will(invocation -> "Mock for Tweet: " + tweet3.getId());
-
- Tweet tweet1 = mock(Tweet.class);
- given(tweet1.getId()).willReturn(1L);
- given(tweet1.getCreatedAt()).willReturn(new GregorianCalendar(2013, 0, 20).getTime());
- given(tweet1.toString()).will(invocation -> "Mock for Tweet: " + tweet1.getId());
-
- final Tweet tweet2 = mock(Tweet.class);
- given(tweet2.getId()).willReturn(2L);
- given(tweet2.getCreatedAt()).willReturn(new GregorianCalendar(2013, 1, 20).getTime());
- given(tweet2.toString()).will(invocation -> "Mock for Tweet: " + tweet2.getId());
-
- final List tweets = new ArrayList();
-
- tweets.add(tweet3);
- tweets.add(tweet1);
- tweets.add(tweet2);
-
- final SearchResults results = new SearchResults(tweets, new SearchMetadata(111, 111));
-
- when(twitterTemplate.searchOperations()).thenReturn(so);
- when(twitterTemplate.searchOperations().search(any(SearchParameters.class))).thenReturn(results);
-
- when(twitterTemplate.isAuthorized()).thenReturn(true);
-
- final UserOperations userOperations = mock(UserOperations.class);
- when(twitterTemplate.userOperations()).thenReturn(userOperations);
- when(userOperations.getProfileId()).thenReturn(74L);
-
- return twitterTemplate;
- }
-
- }
-
-}
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/inbound/TimelineReceivingMessageSourceTests.java b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/inbound/TimelineReceivingMessageSourceTests.java
deleted file mode 100644
index 29eaaacaba..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/inbound/TimelineReceivingMessageSourceTests.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.integration.twitter.inbound;
-
-import java.util.Properties;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import org.springframework.beans.factory.config.PropertiesFactoryBean;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.messaging.Message;
-import org.springframework.social.twitter.api.Tweet;
-import org.springframework.social.twitter.api.impl.TwitterTemplate;
-
-
-/**
- * @author Oleg Zhurakousky
- * @author Gary Russell
- */
-public class TimelineReceivingMessageSourceTests {
-
- private final Log logger = LogFactory.getLog(getClass());
-
- @SuppressWarnings("unchecked")
- @Test
- @Ignore
- public void demoReceiveTimeline() throws Exception {
- PropertiesFactoryBean pf = new PropertiesFactoryBean();
- pf.setLocation(new ClassPathResource("sample.properties"));
- pf.afterPropertiesSet();
- Properties prop = pf.getObject();
- TwitterTemplate template = new TwitterTemplate(prop.getProperty("z_oleg.oauth.consumerKey"),
- prop.getProperty("z_oleg.oauth.consumerSecret"),
- prop.getProperty("z_oleg.oauth.accessToken"),
- prop.getProperty("z_oleg.oauth.accessTokenSecret"));
- TimelineReceivingMessageSource tSource = new TimelineReceivingMessageSource(template, "foo");
- tSource.afterPropertiesSet();
- for (int i = 0; i < 50; i++) {
- Message message = (Message) tSource.receive();
- if (message != null) {
- Tweet tweet = message.getPayload();
- logger.info(tweet.getFromUser() + " - " + tweet.getText() + " - " + tweet.getCreatedAt());
- }
- }
- }
-
-}
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/outbound/DirectMessageSendingMessageHandlerTests.java b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/outbound/DirectMessageSendingMessageHandlerTests.java
deleted file mode 100644
index 1ede6f0866..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/outbound/DirectMessageSendingMessageHandlerTests.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.integration.twitter.outbound;
-
-import java.util.Properties;
-
-import org.junit.Ignore;
-import org.junit.Test;
-
-import org.springframework.beans.factory.config.PropertiesFactoryBean;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.integration.support.MessageBuilder;
-import org.springframework.integration.twitter.core.TwitterHeaders;
-import org.springframework.messaging.Message;
-import org.springframework.social.twitter.api.impl.TwitterTemplate;
-
-/**
- * @author Oleg Zhurakousky
- * @author Mark Fisher
- * @author Gary Russell
- */
-public class DirectMessageSendingMessageHandlerTests {
-
- @Test
- @Ignore
- public void validateSendDirectMessage() throws Exception {
- PropertiesFactoryBean pf = new PropertiesFactoryBean();
- pf.setLocation(new ClassPathResource("sample.properties"));
- pf.afterPropertiesSet();
- Properties prop = pf.getObject();
- TwitterTemplate template = new TwitterTemplate(prop.getProperty("spring_eip.oauth.consumerKey"),
- prop.getProperty("spring_eip.oauth.consumerSecret"),
- prop.getProperty("spring_eip.oauth.accessToken"),
- prop.getProperty("spring_eip.oauth.accessTokenSecret"));
- Message> message1 = MessageBuilder.withPayload("Polsihing SI Twitter migration")
- .setHeader(TwitterHeaders.DM_TARGET_USER_ID, "z_oleg").build();
- DirectMessageSendingMessageHandler handler = new DirectMessageSendingMessageHandler(template);
- handler.afterPropertiesSet();
- handler.handleMessage(message1);
- }
-
-}
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/outbound/StatusUpdatingMessageHandlerTests-context.xml b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/outbound/StatusUpdatingMessageHandlerTests-context.xml
deleted file mode 100644
index 59e46de663..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/outbound/StatusUpdatingMessageHandlerTests-context.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/outbound/StatusUpdatingMessageHandlerTests.java b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/outbound/StatusUpdatingMessageHandlerTests.java
deleted file mode 100644
index 43be6cffc9..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/outbound/StatusUpdatingMessageHandlerTests.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.integration.twitter.outbound;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-import java.util.Collections;
-import java.util.Properties;
-
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Mockito;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.config.PropertiesFactoryBean;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.integration.support.MessageBuilder;
-import org.springframework.messaging.Message;
-import org.springframework.messaging.MessageChannel;
-import org.springframework.messaging.support.GenericMessage;
-import org.springframework.social.twitter.api.TimelineOperations;
-import org.springframework.social.twitter.api.TweetData;
-import org.springframework.social.twitter.api.Twitter;
-import org.springframework.social.twitter.api.impl.TwitterTemplate;
-import org.springframework.test.annotation.DirtiesContext;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.util.MultiValueMap;
-
-/**
- * @author Oleg Zhurakousky
- * @author Artem Bilan
- * @since 2.0
- */
-@ContextConfiguration
-@RunWith(SpringJUnit4ClassRunner.class)
-@DirtiesContext
-public class StatusUpdatingMessageHandlerTests {
-
- @Autowired
- MessageChannel in1;
-
- @Autowired
- MessageChannel in2;
-
- @Autowired
- Twitter twitter;
-
- @Test
- @Ignore
- public void demoSendStatusMessage() throws Exception {
- PropertiesFactoryBean pf = new PropertiesFactoryBean();
- pf.setLocation(new ClassPathResource("sample.properties"));
- pf.afterPropertiesSet();
- Properties prop = pf.getObject();
- TwitterTemplate template = new TwitterTemplate(prop.getProperty("z_oleg.oauth.consumerKey"),
- prop.getProperty("z_oleg.oauth.consumerSecret"),
- prop.getProperty("z_oleg.oauth.accessToken"),
- prop.getProperty("z_oleg.oauth.accessTokenSecret"));
- Message> message1 = new GenericMessage<>("Polishing #springintegration migration to Spring Social. test");
- StatusUpdatingMessageHandler handler = new StatusUpdatingMessageHandler(template);
- handler.afterPropertiesSet();
- handler.handleMessage(message1);
- }
-
- @Test
- public void testStatusUpdatingMessageHandler() {
- TimelineOperations timelineOperations = Mockito.mock(TimelineOperations.class);
- Mockito.when(this.twitter.timelineOperations()).thenReturn(timelineOperations);
-
- ArgumentCaptor argument = ArgumentCaptor.forClass(TweetData.class);
-
- this.in1.send(new GenericMessage("foo"));
-
- Mockito.verify(timelineOperations).updateStatus(argument.capture());
- assertEquals("foo", argument.getValue().toRequestParameters().getFirst("status"));
-
- Mockito.reset(timelineOperations);
-
- ClassPathResource media = new ClassPathResource("log4j.properties");
- this.in2.send(MessageBuilder.withPayload(Collections.singletonMap("foo", "bar"))
- .setHeader("media", media)
- .build());
-
- Mockito.verify(timelineOperations).updateStatus(argument.capture());
- TweetData tweetData = argument.getValue();
- MultiValueMap requestParameters = tweetData.toRequestParameters();
- assertEquals("bar", requestParameters.getFirst("status"));
- assertNull(requestParameters.getFirst("media"));
- MultiValueMap uploadMediaParameters = tweetData.toUploadMediaParameters();
- assertEquals(media, uploadMediaParameters.getFirst("media"));
- }
-
-}
diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/outbound/TwitterSearchOutboundGatewayTests.java b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/outbound/TwitterSearchOutboundGatewayTests.java
deleted file mode 100644
index 64af482d0e..0000000000
--- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/outbound/TwitterSearchOutboundGatewayTests.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Copyright 2014-2017 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.integration.twitter.outbound;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.expression.spel.standard.SpelExpressionParser;
-import org.springframework.integration.channel.QueueChannel;
-import org.springframework.integration.config.EnableIntegration;
-import org.springframework.integration.twitter.core.TwitterHeaders;
-import org.springframework.integration.twitter.outbound.TwitterSearchOutboundGatewayTests.TwitterConfig;
-import org.springframework.messaging.Message;
-import org.springframework.messaging.PollableChannel;
-import org.springframework.messaging.support.GenericMessage;
-import org.springframework.social.twitter.api.SearchMetadata;
-import org.springframework.social.twitter.api.SearchOperations;
-import org.springframework.social.twitter.api.SearchParameters;
-import org.springframework.social.twitter.api.SearchResults;
-import org.springframework.social.twitter.api.Tweet;
-import org.springframework.social.twitter.api.Twitter;
-import org.springframework.test.annotation.DirtiesContext;
-import org.springframework.test.annotation.DirtiesContext.ClassMode;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-/**
- * @author Gary Russell
- * @author Artem Bilan
- * @since 4.0
- *
- */
-@ContextConfiguration(classes = TwitterConfig.class)
-@RunWith(SpringJUnit4ClassRunner.class)
-@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD)
-public class TwitterSearchOutboundGatewayTests {
-
- @Autowired
- private SearchOperations searchOps;
-
- @Autowired
- private TwitterSearchOutboundGateway gateway;
-
- @Autowired
- private PollableChannel outputChannel;
-
- @Test
- public void testStringQuery() {
- Tweet tweet = mock(Tweet.class);
- SearchMetadata searchMetadata = mock(SearchMetadata.class);
- final SearchResults searchResults = new SearchResults(Collections.singletonList(tweet), searchMetadata);
- doAnswer(invocation -> {
- SearchParameters searchParameters = invocation.getArgument(0);
- assertEquals("foo", searchParameters.getQuery());
- assertEquals(Integer.valueOf(20), searchParameters.getCount());
- return searchResults;
- }).when(this.searchOps).search(any(SearchParameters.class));
- this.gateway.handleMessage(new GenericMessage("foo"));
- Message> reply = this.outputChannel.receive(0);
- assertNotNull(reply);
- @SuppressWarnings("unchecked")
- List tweets = (List) reply.getPayload();
- assertEquals(1, tweets.size());
- assertSame(tweet, tweets.get(0));
- assertSame(searchMetadata, reply.getHeaders().get(TwitterHeaders.SEARCH_METADATA));
- }
-
- @Test
- public void testStringQueryCustomLimit() {
- this.gateway.setSearchArgsExpression(new SpelExpressionParser()
- .parseExpression("{payload, 30}"));
- Tweet tweet = mock(Tweet.class);
- SearchMetadata searchMetadata = mock(SearchMetadata.class);
- final SearchResults searchResults = new SearchResults(Collections.singletonList(tweet), searchMetadata);
- doAnswer(invocation -> {
- SearchParameters searchParameters = invocation.getArgument(0);
- assertEquals("foo", searchParameters.getQuery());
- assertEquals(Integer.valueOf(30), searchParameters.getCount());
- return searchResults;
- }).when(this.searchOps).search(any(SearchParameters.class));
- this.gateway.handleMessage(new GenericMessage("foo"));
- Message> reply = this.outputChannel.receive(0);
- assertNotNull(reply);
- @SuppressWarnings("unchecked")
- List tweets = (List) reply.getPayload();
- assertEquals(1, tweets.size());
- assertSame(tweet, tweets.get(0));
- assertSame(searchMetadata, reply.getHeaders().get(TwitterHeaders.SEARCH_METADATA));
- }
-
- @Test
- public void testStringQueryCustomExpression() {
- this.gateway.setSearchArgsExpression(new SpelExpressionParser()
- .parseExpression("{'bar', 1, 2, 3}"));
- Tweet tweet = mock(Tweet.class);
- SearchMetadata searchMetadata = mock(SearchMetadata.class);
- final SearchResults searchResults = new SearchResults(Collections.singletonList(tweet), searchMetadata);
- doAnswer(invocation -> {
- SearchParameters searchParameters = invocation.getArgument(0);
- assertEquals("bar", searchParameters.getQuery());
- assertEquals(Integer.valueOf(1), searchParameters.getCount());
- assertEquals(Long.valueOf(2), searchParameters.getSinceId());
- assertEquals(Long.valueOf(3), searchParameters.getMaxId());
- return searchResults;
- }).when(this.searchOps).search(any(SearchParameters.class));
- this.gateway.handleMessage(new GenericMessage("foo"));
- Message> reply = this.outputChannel.receive(0);
- assertNotNull(reply);
- @SuppressWarnings("unchecked")
- List tweets = (List) reply.getPayload();
- assertEquals(1, tweets.size());
- assertSame(tweet, tweets.get(0));
- assertSame(searchMetadata, reply.getHeaders().get(TwitterHeaders.SEARCH_METADATA));
- }
-
- @Test
- public void testSearchParamsQuery() {
- Tweet tweet = mock(Tweet.class);
- SearchMetadata searchMetadata = mock(SearchMetadata.class);
- final SearchResults searchResults = new SearchResults(Collections.singletonList(tweet), searchMetadata);
- final SearchParameters parameters = new SearchParameters("bar");
- doAnswer(invocation -> {
- SearchParameters searchParameters = invocation.getArgument(0);
- assertSame(parameters, searchParameters);
- return searchResults;
- }).when(this.searchOps).search(any(SearchParameters.class));
- this.gateway.handleMessage(new GenericMessage(parameters));
- Message> reply = this.outputChannel.receive(0);
- assertNotNull(reply);
- @SuppressWarnings("unchecked")
- List tweets = (List) reply.getPayload();
- assertEquals(1, tweets.size());
- assertSame(tweet, tweets.get(0));
- assertSame(searchMetadata, reply.getHeaders().get(TwitterHeaders.SEARCH_METADATA));
- }
-
- @Test
- public void testSearchParamsQueryCustomExpression() {
- this.gateway.setSearchArgsExpression(new SpelExpressionParser()
- .parseExpression("new SearchParameters('foo' + payload).count(5).sinceId(11)"));
- Tweet tweet = mock(Tweet.class);
- SearchMetadata searchMetadata = mock(SearchMetadata.class);
- final SearchResults searchResults = new SearchResults(Collections.singletonList(tweet), searchMetadata);
- doAnswer(invocation -> {
- SearchParameters searchParameters = invocation.getArgument(0);
- assertEquals("foobar", searchParameters.getQuery());
- assertEquals(Integer.valueOf(5), searchParameters.getCount());
- assertEquals(Long.valueOf(11), searchParameters.getSinceId());
- return searchResults;
- }).when(this.searchOps).search(any(SearchParameters.class));
- this.gateway.handleMessage(new GenericMessage("bar"));
- Message> reply = this.outputChannel.receive(0);
- assertNotNull(reply);
- @SuppressWarnings("unchecked")
- List tweets = (List) reply.getPayload();
- assertEquals(1, tweets.size());
- assertSame(tweet, tweets.get(0));
- assertSame(searchMetadata, reply.getHeaders().get(TwitterHeaders.SEARCH_METADATA));
- }
-
- @Test
- public void testEmptyResult() {
- SearchMetadata searchMetadata = mock(SearchMetadata.class);
- List empty = new ArrayList(0);
- final SearchResults searchResults = new SearchResults(empty, searchMetadata);
- doAnswer(invocation -> {
- SearchParameters searchParameters = invocation.getArgument(0);
- assertEquals("foo", searchParameters.getQuery());
- assertEquals(Integer.valueOf(20), searchParameters.getCount());
- return searchResults;
- }).when(this.searchOps).search(any(SearchParameters.class));
- this.gateway.handleMessage(new GenericMessage("foo"));
- Message> reply = this.outputChannel.receive(0);
- assertNotNull(reply);
- @SuppressWarnings("unchecked")
- List tweets = (List) reply.getPayload();
- assertEquals(0, tweets.size());
- assertSame(searchMetadata, reply.getHeaders().get(TwitterHeaders.SEARCH_METADATA));
- }
-
- @Configuration
- @EnableIntegration
- public static class TwitterConfig {
-
- @Bean
- public TwitterSearchOutboundGateway gateway() {
- TwitterSearchOutboundGateway gateway = new TwitterSearchOutboundGateway(twitter());
- gateway.setOutputChannel(outputChannel());
- return gateway;
- }
-
- @Bean
- public PollableChannel outputChannel() {
- return new QueueChannel();
- }
-
- @Bean
- public Twitter twitter() {
- Twitter twitter = mock(Twitter.class);
- when(twitter.searchOperations()).thenReturn(searchOps());
- return twitter;
- }
-
- @Bean
- public SearchOperations searchOps() {
- return mock(SearchOperations.class);
- }
-
- }
-
-}
diff --git a/spring-integration-twitter/src/test/resources/log4j2-test.xml b/spring-integration-twitter/src/test/resources/log4j2-test.xml
deleted file mode 100644
index ff3b0a5bbc..0000000000
--- a/spring-integration-twitter/src/test/resources/log4j2-test.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/spring-integration-twitter/src/test/resources/twitter.receiver.properties b/spring-integration-twitter/src/test/resources/twitter.receiver.properties
deleted file mode 100644
index 4bd8eb5301..0000000000
--- a/spring-integration-twitter/src/test/resources/twitter.receiver.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-# oauth setup for prosibook twitter account
-twitter.oauth.consumerKey=
-twitter.oauth.consumerSecret=
-twitter.oauth.accessToken=
-twitter.oauth.accessTokenSecret=
diff --git a/spring-integration-twitter/src/test/resources/twitter.sender.properties b/spring-integration-twitter/src/test/resources/twitter.sender.properties
deleted file mode 100644
index ab585c9761..0000000000
--- a/spring-integration-twitter/src/test/resources/twitter.sender.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-twitter.oauth.consumerKey=
-twitter.oauth.consumerSecret=
-twitter.oauth.accessToken=
-twitter.oauth.accessTokenSecret=
-twitter.oauth.pin=
diff --git a/src/reference/asciidoc/changes-1.0-2.0.adoc b/src/reference/asciidoc/changes-1.0-2.0.adoc
index ffbcc14447..b04bd42cf0 100644
--- a/src/reference/asciidoc/changes-1.0-2.0.adoc
+++ b/src/reference/asciidoc/changes-1.0-2.0.adoc
@@ -88,9 +88,9 @@ See also the following blog: http://blog.springsource.com/2010/03/29/using-udp-a
[[new-twitter]]
===== Twitter Adapters
-Twitter adapters provide support for sending and receiving Twitter status updates and direct messages.
-You can also perform Twitter searches with an inbound channel adapter.
-See "`<>`" for more details.
+Twitter adapters provides support for sending and receiving Twitter Status updates as well as Direct Messages.
+You can also perform Twitter Searches with an inbound Channel Adapter.
+See https://github.com/spring-projects/spring-integration-extensions/tree/master/spring-integration-social-twitter[Spring Integration Social Twitter] for more details.
[[new-xmpp]]
===== XMPP Adapters
diff --git a/src/reference/asciidoc/changes-3.0-4.0.adoc b/src/reference/asciidoc/changes-3.0-4.0.adoc
index cd70d9f10f..97977bfdde 100644
--- a/src/reference/asciidoc/changes-3.0-4.0.adoc
+++ b/src/reference/asciidoc/changes-3.0-4.0.adoc
@@ -126,9 +126,9 @@ For more information, see "`<>`".
[[x4.0-twitter-sog]]
===== Twitter Search Outbound Gateway
-We added a new twitter endpoint: ``.
-Unlike the search inbound adapter, which polls by using the same search query each time, the outbound gateway allows on-demand customized queries.
-For more information, see "`<>`".
+A new twitter endpoint `` has been added.
+Unlike the search inbound adapter which polls using the same search query each time, the outbound gateway allows on-demand customized queries.
+For more information, see https://github.com/spring-projects/spring-integration-extensions/tree/master/spring-integration-social-twitter[Spring Integration Social Twitter].
[[x4.0-gemfire-metadata]]
===== Gemfire Metadata Store
@@ -246,9 +246,8 @@ See "`<>`" for more information.
[[x4.0-twitter-status-updating]]
===== Twitter: `StatusUpdatingMessageHandler`
-The `StatusUpdatingMessageHandler` (``) now supports the `tweet-data-expression` attribute to build a `org.springframework.social.twitter.api.TweetData` object for updating the timeline status.
-This feature allows, for example, attaching an image.
-See "`<>`" for more information.
+The `StatusUpdatingMessageHandler` (``) now supports the `tweet-data-expression` attribute to build a `org.springframework.social.twitter.api.TweetData` object for updating the timeline status allowing, for example, attaching an image.
+See https://github.com/spring-projects/spring-integration-extensions/tree/master/spring-integration-social-twitter[Spring Integration Social Twitter] for more information.
[[x4.0-jpa-id-expression]]
===== JPA Retrieving Gateway: `id-expression`
diff --git a/src/reference/asciidoc/endpoint-summary.adoc b/src/reference/asciidoc/endpoint-summary.adoc
index 1265c60465..99bc2b9147 100644
--- a/src/reference/asciidoc/endpoint-summary.adoc
+++ b/src/reference/asciidoc/endpoint-summary.adoc
@@ -154,12 +154,6 @@ The following table summarizes the various endpoints with quick links to the app
| <>
| <>
-| *Twitter*
-| <>
-| <>
-| N
-| <>
-
| *UDP*
| <>
| <>
diff --git a/src/reference/asciidoc/gemfire.adoc b/src/reference/asciidoc/gemfire.adoc
index 523f550722..e83e33e7e3 100644
--- a/src/reference/asciidoc/gemfire.adoc
+++ b/src/reference/asciidoc/gemfire.adoc
@@ -246,14 +246,13 @@ Version 4.0 introduced a new Gemfire-based `MetadataStore` (<>)
You can use the `GemfireMetadataStore` to maintain metadata state across application restarts.
This new `MetadataStore` implementation can be used with adapters such as:
-* <>
* <>
* <>
* <>
* <>
To get these adapters to use the new `GemfireMetadataStore`, declare a Spring bean with a bean name of `metadataStore`.
-The Twitter inbound channel adapter and the feed inbound channel adapter both automatically pick up and use the declared `GemfireMetadataStore`.
+The feed inbound channel adapter automatically picks up and use the declared `GemfireMetadataStore`.
NOTE: The `GemfireMetadataStore` also implements `ConcurrentMetadataStore`, letting it be reliably shared across multiple application instances, where only one instance can store or modify a key's value.
These methods give various levels of concurrency guarantees based on the scope and data policy of the region.
diff --git a/src/reference/asciidoc/index.adoc b/src/reference/asciidoc/index.adoc
index c4b93e24b2..f4b5d8c828 100644
--- a/src/reference/asciidoc/index.adoc
+++ b/src/reference/asciidoc/index.adoc
@@ -113,8 +113,6 @@ include::./syslog.adoc[]
include::./ip.adoc[]
-include::./twitter.adoc[]
-
include::./webflux.adoc[]
include::./web-sockets.adoc[]
diff --git a/src/reference/asciidoc/jdbc.adoc b/src/reference/asciidoc/jdbc.adoc
index 181f4cb3e0..68e1d0cad2 100644
--- a/src/reference/asciidoc/jdbc.adoc
+++ b/src/reference/asciidoc/jdbc.adoc
@@ -1057,13 +1057,14 @@ Version 5.0 introduced the JDBC `MetadataStore` (see "`<>`") imp
You can use the `JdbcMetadataStore` to maintain the metadata state across application restarts.
This `MetadataStore` implementation can be used with adapters such as the following:
-* <>
+
* <>
* <>
* <>
* <>
-To configure these adapters to use the `JdbcMetadataStore`, declare a Spring bean by using a bean name of `metadataStore`. The Twitter inbound channel adapter and the feed inbound channel adapter both automatically pick up and use the declared `JdbcMetadataStore`, as the following example shows:
+To configure these adapters to use the `JdbcMetadataStore`, declare a Spring bean by using a bean name of `metadataStore`.
+The Feed inbound channel adapter and the feed inbound channel adapter both automatically pick up and use the declared `JdbcMetadataStore`, as the following example shows:
====
[source,java]
diff --git a/src/reference/asciidoc/mongodb.adoc b/src/reference/asciidoc/mongodb.adoc
index bd16caf8f9..43376e8fb7 100644
--- a/src/reference/asciidoc/mongodb.adoc
+++ b/src/reference/asciidoc/mongodb.adoc
@@ -160,14 +160,14 @@ Spring Integration 4.2 introduced a new MongoDB-based `MetadataStore` (see "`<>
+
* <>
* <>
* <>
* <>
To instruct these adapters to use the new `MongoDbMetadataStore`, declare a Spring bean with a bean name of `metadataStore`.
-The Twitter inbound channel adapter and the feed inbound channel adapter both automatically pick up and use the declared `MongoDbMetadataStore`.
+The feed inbound channel adapter automatically picks up and use the declared `MongoDbMetadataStore`.
The following example shows how to declare a bean with a name of `metadataStore`:
====
diff --git a/src/reference/asciidoc/preface.adoc b/src/reference/asciidoc/preface.adoc
index 3e268c8e84..a092c060c7 100644
--- a/src/reference/asciidoc/preface.adoc
+++ b/src/reference/asciidoc/preface.adoc
@@ -31,8 +31,8 @@ Spring Framework 2.0 introduced support for namespaces, which simplifies the XML
In this reference guide, the `int` namespace prefix is used for Spring Integration's core namespace support.
Each Spring Integration adapter type (also called a module) provides its own namespace, which is configured by using the following convention:
-`int-` followed by the name of the module -- for example, `int-twitter`, `int-stream`, and so on.
-The following example shows the `int`, `int-twitter`, and `int-stream` namespaces in use:
+
+The following example shows the `int`, `int-event`, and `int-stream` namespaces in use:
====
[source,xml]
@@ -41,15 +41,15 @@ The following example shows the `int`, `int-twitter`, and `int-stream` namespace
…
diff --git a/src/reference/asciidoc/redis.adoc b/src/reference/asciidoc/redis.adoc
index 32579b5a4c..9debb32fdd 100644
--- a/src/reference/asciidoc/redis.adoc
+++ b/src/reference/asciidoc/redis.adoc
@@ -397,14 +397,14 @@ Spring Integration 3.0 introduced a new Redis-based http://docs.spring.io/spring
You can use the `RedisMetadataStore` to maintain the state of a `MetadataStore` across application restarts.
You can use this new `MetadataStore` implementation with adapters such as:
-* <>
+
* <>
* <>
* <>
* <>
To instruct these adapters to use the new `RedisMetadataStore`, declare a Spring bean named `metadataStore`.
-The Twitter inbound channel adapter and the feed inbound channel adapter both automatically pick up and use the declared `RedisMetadataStore`.
+The Feed inbound channel adapter and the feed inbound channel adapter both automatically pick up and use the declared `RedisMetadataStore`.
The following example shows how to declare such a bean:
====
diff --git a/src/reference/asciidoc/twitter.adoc b/src/reference/asciidoc/twitter.adoc
deleted file mode 100644
index 351063c376..0000000000
--- a/src/reference/asciidoc/twitter.adoc
+++ /dev/null
@@ -1,387 +0,0 @@
-[[twitter]]
-== Twitter Support
-
-Spring Integration provides support for interacting with Twitter.
-With the Twitter adapters, you can both receive and send Twitter messages.
-You can also perform a Twitter search based on a schedule and publish the search results within messages.
-Since version 4.0, a search outbound gateway is provided to perform dynamic searches.
-
-Twitter is a social networking and micro-blogging service that enables its users to send and read messages known as tweets.
-Tweets are text-based posts of up to 280 characters (up from 140 in 2018) displayed on the author's profile page and delivered to the author's subscribers, who are known as followers.
-
-IMPORTANT: Versions of Spring Integration prior to 2.1 were dependent upon the http://twitter4j.org[Twitter4J API].
-However, with the release of http://projects.spring.io/spring-social[Spring Social 1.0 GA], Spring Integration (as of version 2.1) now builds directly upon Spring Social's Twitter support, instead of Twitter4J.
-All Twitter endpoints require the configuration of a `TwitterTemplate`, because even search operations require an authenticated template.
-
-Spring Integration provides a convenient namespace configuration to define Twitter artifacts.
-You can enable it by adding the following within your XML header:
-
-====
-[source,xml]
-----
-xmlns:int-twitter="http://www.springframework.org/schema/integration/twitter"
-xsi:schemaLocation="http://www.springframework.org/schema/integration/twitter
-http://www.springframework.org/schema/integration/twitter/spring-integration-twitter.xsd"
-----
-====
-
-[[twitter-oauth]]
-=== Twitter OAuth Configuration
-
-For authenticated operations, Twitter uses OAuth, an authentication protocol that lets users approve an application to act on their behalf without sharing their password.
-More information can be found at http://oauth.net[http://oauth.net] or in http://hueniverse.com/oauth[this article] from Hueniverse.
-See the http://dev.twitter.com/pages/oauth_faq[OAuth FAQ] for more information about OAuth and Twitter.
-
-In order to use OAuth authentication and authorization with Twitter, you must create a new application on the Twitter Developers site.
-The following directions describe how to create a new application and obtain consumer keys and an access token:
-
-. Go to http://dev.twitter.com[http://dev.twitter.com].
-
-. Click on the `Register an app` link and fill out all required fields on the form provided.
-Set `Application Type` to `Client` and, depending on the nature of your application, set `Default Access Type` to `Read & Write` or `Read-only`.
-Submit the form.
-If everything is successful, you see the `Consumer Key` and `Consumer Secret`.
-Copy both values in a safe place.
-
-. On the same page, you should see a `My Access Token` button on the side bar (right).
-Click on it and you should see two more values: `Access Token` and `Access Token Secret`.
-Copy these values in a safe place as well.
-
-=== Twitter Template
-
-As <>, Spring Integration relies upon Spring Social.
-That library provides an implementation of the template pattern( `o.s.social.twitter.api.impl.TwitterTemplate`) to let you interact with Twitter.
-For anonymous operations (such as search), you need not explicitly define an instance of `TwitterTemplate`, since a default instance is created and injected into the endpoint.
-However, for authenticated operations (update status, send direct message, asd others), you must configure a `TwitterTemplate` as a bean and inject it explicitly into the endpoint, because the authentication configuration is required.
-The following example configures a TwitterTemplate:
-
-====
-[source,xml]
-----
-
-----
-====
-
-NOTE: The values above are not real.
-
-As the preceding configuration shows, all you need to do is to provide OAuth `attributes` as constructor arguments.
-The values should be those you obtained in the previous step.
-The order of constructor arguments is:
-. `consumerKey`
-. `consumerSecret`
-. `accessToken`
-. `accessTokenSecret`.
-
-A more practical way to manage OAuth connection attributes is to use Spring's property placeholder support by creating a property file (for example, oauth.properties), as the following example shows:
-
-====
-[source,java]
-----
-twitter.oauth.consumerKey=4XzBPacJQxyBzzzH
-twitter.oauth.consumerSecret=AbRxUAvyCtqQtvxFK8w5ZMtMj20KFhB6o
-twitter.oauth.accessToken=21691649-4YZY5iJEOfz2A9qCFd9SjBRGb3HLmIm4HNE
-twitter.oauth.accessTokenSecret=AbRxUAvyNCtqQtxFK8w5ZMtMj20KFhB6o
-----
-====
-
-Then you can configure a `property-placeholder` to point to the above property file, as the following example shows:
-
-====
-[source,xml]
-----
-
-
-
-----
-====
-
-[[twitter-inbound]]
-=== Twitter Inbound Adapters
-
-Twitter inbound adapters let you receive Twitter Messages.
-There are several types of http://support.twitter.com/articles/119138-types-of-tweets-and-where-they-appear[twitter messages, or tweets].
-
-As of version 2.0, Spring Integration provides support for receiving tweets as timeline updates, direct messages, and mention messages (as well as search results).
-
-[IMPORTANT]
-=====
-Every inbound Twitter channel adapter is a polling consumer, which means you have to provide a poller configuration.
-Twitter uses a concept called https://dev.twitter.com/docs/rate-limiting/1.1[Rate Limiting].
-In a nutshell, Twitter uses rate limiting to manage how often an application can poll for updates.
-You should consider this when setting your poller intervals so that the adapter polls in compliance with Twitter policies.
-
-With Spring Integration prior to version 3.0, a hard-coded limit within the adapters was used to ensure the polling interval could not be less than 15 seconds.
-This is no longer the case, and the poller configuration is applied directly.
-=====
-
-Another issue that you need to consider is handling duplicate Tweets.
-The same adapter (for example, search or timeline update), while polling on Twitter, may receive the same values more than once.
-For example, if you keep searching on Twitter with the same search criteria, you end up with the same set of tweets unless some new tweet that matches your search criteria was posted in between your searches.
-In that situation, you get all the tweets you had before plus the new one.
-However, you really want only the new tweet.
-Spring Integration provides an elegant mechanism for handling these situations.
-The latest Tweet ID (the last retrieved tweet in this case) is stored in an instance of the `org.springframework.integration.metadata.MetadataStore` strategy .
-For more information, see "`<>`".
-
-NOTE: The key used to persist the latest Twitter ID is the value of the (required) `id` attribute of the Twitter inbound channel adapter component plus the `profileId` of the Twitter user.
-
-Prior to version 4.0, the page size was hard-coded to 20.
-You can now configure it by using the `page-size` attribute (which defaults to 20).
-
-[[inbound-twitter-update]]
-==== Inbound Message Channel Adapter
-
-This adapter lets you receive updates from everyone you follow.
-It is essentially the "`timeline update`" adapter.
-The following example configures a Twitter inbound channel adapter to poll for at most three messages every five seconds:
-
-====
-[source,xml]
-----
-
-
-
-----
-====
-
-[[inbound-twitter-direct]]
-==== Direct Inbound Message Channel Adapter
-
-This adapter lets you receive direct messages that were sent to you from other Twitter users.
-The following example configures a Twitter direct message inbound channel adapter to poll for at most three direct messages every five seconds:
-
-====
-[source,xml]
-----
-
-
-
-----
-====
-
-[[inbound-twitter-mention]]
-==== Mentions Inbound Message Channel Adapter
-
-This adapter lets you receive Twitter messages that mention you when someone uses the `@user` syntax.
-The following example configures a Twitter mention inbound channel adapter to poll for at most three mentions every five seconds:
-
-====
-[source,xml]
-----
-
-
-
-----
-====
-
-[[inbound-twitter-search]]
-==== Search Inbound Message Channel Adapter
-
-This adapter lets you perform searches.
-You need not define a `twitter-template`, because you can search anonymously.
-However you must define a search query.
-The following example configures a Twitter search inbound channel adapter that searchs for the `#springintegration` hashtag and returns at most three results every five seconds:
-
-====
-[source,xml]
-----
-
-
-
-----
-====
-
-See https://dev.twitter.com/docs/using-search to learn more about Twitter queries.
-
-The configuration of all of these adapters is similar to other inbound adapters, with one exception: Some may need to have the `twitter-template` injected.
-Once received, each Twitter message is encapsulated in a Spring Integration `Message` and sent to the channel specified by the `channel` attribute.
-
-NOTE: Currently, the payload type of any Twitter `Message` is `org.springframework.integration.twitter.core.Tweet`, which is very similar to the object with the same name in Spring Social.
-As we migrate to Spring Social, we plan to depend on its API.
-Some of the artifacts that we currently use are about to be obsolete.
-However, we have already made sure that the impact of such migration is minimal, by aligning our API with the current state (at the time of this writing) of Spring Social.
-
-To get the text from the `org.springframework.social.twitter.api.Tweet`, invoke the `getText()` method.
-
-[[twitter-outbound]]
-=== Twitter Outbound Adapter
-
-Twitter outbound channel adapters let you send Twitter Messages (called tweets).
-
-As of version 2.0, Spring Integration supports sending status update messages and direct messages.
-Twitter outbound channel adapters take the `Message` payload and send it as a Twitter message.
-Currently, the only supported payload type is `String`, so you should consider adding a transformer if the payload of the incoming message is not a `String`.
-
-[[outbound-twitter-update]]
-==== Twitter Outbound Update Channel Adapter
-
-This adapter lets you send regular status updates by sending a `Message` to the channel identified by the `channel` attribute.
-The following example configures a basic Twitter outbound channel adapter:
-
-====
-[source,xml]
-----
-
-----
-====
-
-The only extra configuration adapter requires is the `twitter-template` reference.
-
-Starting with version 4.0, the `` element supports a `tweet-data-expression` attribute to populate the `TweetData` argument (see http://projects.spring.io/spring-social-twitter/[Spring Social Twitter]) by using the message as the root object of the expression evaluation context.
-The result can be one of the following:
-
-* A `String`, which is used for the `TweetData` message
-* A `Tweet` object, the `text` of which is used for the `TweetData` message
-* An entire `TweetData` object.
-
-For convenience, the `TweetData` object can be built from the expression directly without needing a fully qualified class name, as the following example shows:
-
-====
-[source,xml]
-----
-
-----
-====
-
-The only extra configuration this adapter requires is the `twitter-template` reference.
-
-When it comes to Twitter direct messages, you must specify to whom you are sending the message (that is, the target user ID).
-The Twitter outbound direct message channel adapter looks for a target user ID in the message headers under the name of `twitter_dmTargetUserId`, which is also identified by the following constant: `TwitterHeaders.DM_TARGET_USER_ID`.
-So, when creating a `Message`, you need only add a value for that header, as the following example shows:
-
-====
-[source,java]
-----
-Message message = MessageBuilder.withPayload("hello")
- .setHeader(TwitterHeaders.DM_TARGET_USER_ID, "z_oleg").build();
-----
-====
-
-The preceding approach works well if you create the `Message` programmatically.
-However, it is more common to provide the header value within a messaging flow.
-The value can be provided by an upstream ``, as the following example shows:
-
-====
-[source,xml]
-----
-
-
-
-----
-====
-
-It is quite common that the value must be determined dynamically.
-For those cases, you can take advantage of SpEL support within the `` by using the `expression` attribute, as the following example shows:
-
-====
-[source,xml]
-----
-
-
-
-----
-====
-
-IMPORTANT: Twitter does not let you post duplicate messages.
-This is a common problem during testing, when the same code works the first time but does not work the second time.
-Consequently, you need to change the content of the message each time.
-Appending a timestamp to the end of each message works well for testing.
-
-[[twitter-sog]]
-=== Twitter Search Outbound Gateway
-
-In Spring Integration, an outbound gateway is used for two-way request-response communication with an external service.
-The Twitter search outbound gateway lets you issue dynamic Twitter searches.
-The reply message payload is a collection of `Tweet` objects.
-If the search returns no results, the payload is an empty collection.
-You can limit the number of tweets, and you can page through a larger set of tweets by making multiple calls.
-To facilitate this, search reply messages contain a header called `twitter_searchMetadata`.
-Its value is a `SearchMetadata` object.
-For more information on the `Tweet`, `SearchParameters`, and `SearchMetadata` classes, see the http://projects.spring.io/spring-social-twitter/[Spring Social Twitter] documentation.
-
-==== Configuring the Twitter Search Outbound Gateway
-
-The following listing shows the available attributes for a Twitter search outbound gateway:
-
-====
-[source,xml]
-----
-