Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0F076200C06 for ; Fri, 27 Jan 2017 13:56:36 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 0DE77160B5B; Fri, 27 Jan 2017 12:56:36 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 35A21160B65 for ; Fri, 27 Jan 2017 13:56:35 +0100 (CET) Received: (qmail 2695 invoked by uid 500); 27 Jan 2017 12:56:34 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 2131 invoked by uid 99); 27 Jan 2017 12:56:34 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jan 2017 12:56:34 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BB2D2DFF88; Fri, 27 Jan 2017 12:56:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: nferraro@apache.org To: commits@camel.apache.org Date: Fri, 27 Jan 2017 12:56:40 -0000 Message-Id: In-Reply-To: <2ded62b682154191bfa10a20bd73e606@git.apache.org> References: <2ded62b682154191bfa10a20bd73e606@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [8/8] camel git commit: added further unit tests for outgoing and incoming documents archived-at: Fri, 27 Jan 2017 12:56:36 -0000 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 Authored: Fri Jan 20 13:56:41 2017 +0100 Committer: Nicola Ferraro 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); + } + }