camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nferr...@apache.org
Subject [8/8] camel git commit: added further unit tests for outgoing and incoming documents
Date Fri, 27 Jan 2017 12:56:40 GMT
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 <mail@steffen-eitelmann.com>
Authored: Fri Jan 20 13:56:41 2017 +0100
Committer: Nicola Ferraro <ni.ferraro@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);
+    }
+
 }


Mime
View raw message