camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nferr...@apache.org
Subject [1/8] camel git commit: CAMEL-10730: small fixes and source check
Date Fri, 27 Jan 2017 12:56:33 GMT
Repository: camel
Updated Branches:
  refs/heads/master 4690b070b -> c5570fb17


CAMEL-10730: small fixes and source check


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c5570fb1
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c5570fb1
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c5570fb1

Branch: refs/heads/master
Commit: c5570fb1730c0552370a605ec6fbeb1df1618765
Parents: 68c7233
Author: Nicola Ferraro <ni.ferraro@gmail.com>
Authored: Fri Jan 27 13:51:45 2017 +0100
Committer: Nicola Ferraro <ni.ferraro@gmail.com>
Committed: Fri Jan 27 13:56:19 2017 +0100

----------------------------------------------------------------------
 .../telegram/service/TelegramServiceRestBotAPIAdapter.java       | 4 ++--
 .../apache/camel/component/telegram/util/TelegramConverter.java  | 2 +-
 .../component/telegram/integration/TelegramServiceTest.java      | 3 +--
 .../apache/camel/component/telegram/util/TelegramTestUtil.java   | 2 +-
 .../camel-telegram/src/test/resources/attachments/sample.txt     | 1 +
 5 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/c5570fb1/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/service/TelegramServiceRestBotAPIAdapter.java
----------------------------------------------------------------------
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/service/TelegramServiceRestBotAPIAdapter.java
b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/service/TelegramServiceRestBotAPIAdapter.java
index 70dce2d..98fd0e8 100644
--- a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/service/TelegramServiceRestBotAPIAdapter.java
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/service/TelegramServiceRestBotAPIAdapter.java
@@ -27,8 +27,8 @@ import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
 
 import org.apache.camel.component.telegram.TelegramService;
 import org.apache.camel.component.telegram.model.OutgoingAudioMessage;
-import org.apache.camel.component.telegram.model.OutgoingMessage;
 import org.apache.camel.component.telegram.model.OutgoingDocumentMessage;
+import org.apache.camel.component.telegram.model.OutgoingMessage;
 import org.apache.camel.component.telegram.model.OutgoingPhotoMessage;
 import org.apache.camel.component.telegram.model.OutgoingTextMessage;
 import org.apache.camel.component.telegram.model.OutgoingVideoMessage;
@@ -65,7 +65,7 @@ public class TelegramServiceRestBotAPIAdapter implements TelegramService
{
             this.sendMessage(authorizationToken, (OutgoingAudioMessage) message);
         } else if (message instanceof OutgoingVideoMessage) {
             this.sendMessage(authorizationToken, (OutgoingVideoMessage) message);
-        } else if(message instanceof OutgoingDocumentMessage) {
+        } else if (message instanceof OutgoingDocumentMessage) {
             this.sendMessage(authorizationToken, (OutgoingDocumentMessage) message);
         } else {
             throw new IllegalArgumentException("Unsupported message type " + (message !=
null ? message.getClass().getName() : null));

http://git-wip-us.apache.org/repos/asf/camel/blob/c5570fb1/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/util/TelegramConverter.java
----------------------------------------------------------------------
diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/util/TelegramConverter.java
b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/util/TelegramConverter.java
index 81433f0..8ff0832 100644
--- a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/util/TelegramConverter.java
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/util/TelegramConverter.java
@@ -168,7 +168,7 @@ public final class TelegramConverter {
 
             result = document;
             break;
-            }
+        }
         }
 
         return result;

http://git-wip-us.apache.org/repos/asf/camel/blob/c5570fb1/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/integration/TelegramServiceTest.java
----------------------------------------------------------------------
diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/integration/TelegramServiceTest.java
b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/integration/TelegramServiceTest.java
index bbf7226..376a3ef 100644
--- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/integration/TelegramServiceTest.java
+++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/integration/TelegramServiceTest.java
@@ -187,8 +187,7 @@ public class TelegramServiceTest {
         OutgoingDocumentMessage msg = new OutgoingDocumentMessage();
         msg.setDocument(document);
         msg.setChatId(chatId);
-        msg.setFilenameWithExtension("file.png");
-
+        msg.setFilenameWithExtension("file.txt");
 
         service.sendMessage(authorizationToken, msg);
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/c5570fb1/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/util/TelegramTestUtil.java
----------------------------------------------------------------------
diff --git a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/util/TelegramTestUtil.java
b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/util/TelegramTestUtil.java
index 1479c9c..9f813dd 100644
--- a/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/util/TelegramTestUtil.java
+++ b/components/camel-telegram/src/test/java/org/apache/camel/component/telegram/util/TelegramTestUtil.java
@@ -59,7 +59,7 @@ public final class TelegramTestUtil {
     }
 
     public static byte[] createSampleDocument() throws IOException {
-        byte[] document = IOUtils.readBytesFromStream(TelegramTestUtil.class.getResourceAsStream("/attachments/sample.png"));
+        byte[] document = IOUtils.readBytesFromStream(TelegramTestUtil.class.getResourceAsStream("/attachments/sample.txt"));
         return document;
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/c5570fb1/components/camel-telegram/src/test/resources/attachments/sample.txt
----------------------------------------------------------------------
diff --git a/components/camel-telegram/src/test/resources/attachments/sample.txt b/components/camel-telegram/src/test/resources/attachments/sample.txt
new file mode 100644
index 0000000..85dbcfc
--- /dev/null
+++ b/components/camel-telegram/src/test/resources/attachments/sample.txt
@@ -0,0 +1 @@
+A sample text file.
\ No newline at end of file


Mime
View raw message