You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2017/01/27 12:56:40 UTC

[8/8] camel git commit: added further unit tests for outgoing and incoming documents

added further unit tests for outgoing and incoming documents


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

Branch: refs/heads/master
Commit: bf663f9f41fd67b1938a716e2d0e5b8960253c5f
Parents: fc745de
Author: Neffez <ma...@steffen-eitelmann.com>
Authored: Fri Jan 20 13:56:41 2017 +0100
Committer: Nicola Ferraro <ni...@gmail.com>
Committed: Fri Jan 27 13:56:19 2017 +0100

----------------------------------------------------------------------
 .../integration/TelegramServiceTest.java        | 36 +++++++++++++++++---
 1 file changed, 31 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/bf663f9f/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 e1721d7..43342ae 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
@@ -20,11 +20,7 @@ import java.io.IOException;
 
 import org.apache.camel.component.telegram.TelegramService;
 import org.apache.camel.component.telegram.TelegramServiceProvider;
-import org.apache.camel.component.telegram.model.OutgoingAudioMessage;
-import org.apache.camel.component.telegram.model.OutgoingPhotoMessage;
-import org.apache.camel.component.telegram.model.OutgoingTextMessage;
-import org.apache.camel.component.telegram.model.OutgoingVideoMessage;
-import org.apache.camel.component.telegram.model.UpdateResult;
+import org.apache.camel.component.telegram.model.*;
 import org.apache.camel.component.telegram.util.TelegramTestUtil;
 import org.junit.Assert;
 import org.junit.BeforeClass;
@@ -177,4 +173,34 @@ public class TelegramServiceTest {
         service.sendMessage(authorizationToken, msg);
     }
 
+    @Test
+    public void testSendDocument() throws IOException {
+        TelegramService service = TelegramServiceProvider.get().getService();
+
+        byte[] document = TelegramTestUtil.createSampleDocument();
+
+        OutgoingDocumentMessage msg = new OutgoingDocumentMessage();
+        msg.setDocument(document);
+        msg.setChatId(chatId);
+        msg.setFilenameWithExtension("file.png");
+
+
+        service.sendMessage(authorizationToken, msg);
+    }
+
+    @Test
+    public void testSendDocumentFull() throws IOException {
+        TelegramService service = TelegramServiceProvider.get().getService();
+
+        byte[] document = TelegramTestUtil.createSampleDocument();
+
+        OutgoingDocumentMessage msg = new OutgoingDocumentMessage();
+        msg.setDocument(document);
+        msg.setChatId(chatId);
+        msg.setFilenameWithExtension("file.png");
+        msg.setCaption("A document");
+
+        service.sendMessage(authorizationToken, msg);
+    }
+
 }