camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [2/3] camel git commit: CAMEL-10291: add test case timestamp as date value for producer
Date Tue, 06 Sep 2016 06:03:56 GMT
CAMEL-10291: add test case timestamp as date value for producer


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

Branch: refs/heads/master
Commit: 9c278bb33ee7e4424034c570d41fb9fa2991dc07
Parents: 65d372f
Author: Florian Gessner <florian.gessner@tis.biz>
Authored: Tue Sep 6 07:30:50 2016 +0200
Committer: Florian Gessner <florian.gessner@tis.biz>
Committed: Tue Sep 6 07:30:50 2016 +0200

----------------------------------------------------------------------
 .../camel/component/rabbitmq/RabbitMQProducerTest.java   | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/9c278bb3/components/camel-rabbitmq/src/test/java/org/apache/camel/component/rabbitmq/RabbitMQProducerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-rabbitmq/src/test/java/org/apache/camel/component/rabbitmq/RabbitMQProducerTest.java
b/components/camel-rabbitmq/src/test/java/org/apache/camel/component/rabbitmq/RabbitMQProducerTest.java
index ee72d8a..523e5c7 100644
--- a/components/camel-rabbitmq/src/test/java/org/apache/camel/component/rabbitmq/RabbitMQProducerTest.java
+++ b/components/camel-rabbitmq/src/test/java/org/apache/camel/component/rabbitmq/RabbitMQProducerTest.java
@@ -152,7 +152,7 @@ public class RabbitMQProducerTest {
     }
 
     @Test
-    public void testPropertiesUsesTimestampHeader() throws IOException {
+    public void testPropertiesUsesTimestampHeaderAsLongValue() throws IOException {
         RabbitMQProducer producer = new RabbitMQProducer(endpoint);
         message.setHeader(RabbitMQConstants.TIMESTAMP, "12345123");
         AMQP.BasicProperties props = producer.buildProperties(exchange).build();
@@ -160,6 +160,15 @@ public class RabbitMQProducerTest {
     }
 
     @Test
+    public void testPropertiesUsesTimestampHeaderAsDateValue() throws IOException {
+        Date timestamp = new Date();
+        RabbitMQProducer producer = new RabbitMQProducer(endpoint);
+        message.setHeader(RabbitMQConstants.TIMESTAMP, timestamp);
+        AMQP.BasicProperties props = producer.buildProperties(exchange).build();
+        assertEquals(timestamp, props.getTimestamp());
+    }
+
+    @Test
     public void testPropertiesUsesCustomHeaders() throws IOException {
         RabbitMQProducer producer = new RabbitMQProducer(endpoint);
         Map<String, Object> customHeaders = new HashMap<String, Object>();


Mime
View raw message