clebertsuconic commented on a change in pull request #3594:
URL: https://github.com/apache/activemq-artemis/pull/3594#discussion_r640740125



##########
File path: 
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMXManagementTest.java
##########
@@ -137,6 +142,45 @@ public void testGetFirstMessage() throws Exception {
       }
    }
 
+   @Test
+   public void testGetFirstMessageWithAMQPTypes() throws Exception {
+      AmqpClient client = createAmqpClient();
+      AmqpConnection connection = addConnection(client.connect());
+
+      try {
+         UUID uuid = UUID.randomUUID();
+         Character character = new Character('C');
+         AmqpSession session = connection.createSession();
+         AmqpSender sender = session.createSender(getQueueName());
+
+         session.begin();
+         AmqpMessage message = new AmqpMessage();
+         message.setApplicationProperty("TEST_UUID", uuid);
+         message.setApplicationProperty("TEST_CHAR", character);
+         message.setApplicationProperty("TEST_DECIMAL_32", new 
Decimal32(BigDecimal.ONE));
+         message.setApplicationProperty("TEST_DECIMAL_64", new 
Decimal64(BigDecimal.ONE));
+         message.setApplicationProperty("TEST_DECIMAL_128", new 
Decimal128(BigDecimal.ONE));
+
+         sender.send(message);
+         session.commit();
+
+         SimpleString queue = new SimpleString(getQueueName());
+         QueueControl queueControl = createManagementControl(queue, queue);
+         String firstMessageAsJSON = queueControl.getFirstMessageAsJSON();
+         Assert.assertNotNull(firstMessageAsJSON);
+
+         JsonObject firstMessageObject = 
JsonUtil.readJsonArray(firstMessageAsJSON).getJsonObject(0);
+
+         Assert.assertEquals(uuid.toString(), 
firstMessageObject.getString("TEST_UUID"));
+         Assert.assertEquals(character.toString(), 
firstMessageObject.getString("TEST_CHAR"));
+         
Assert.assertNotNull(firstMessageObject.getJsonNumber("TEST_DECIMAL_32").doubleValue());

Review comment:
       I am merging with a slight change here.. no need to check for 
.doubleValue()..I'm amending the change as yours..




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to