clebertsuconic commented on code in PR #4840:
URL: https://github.com/apache/activemq-artemis/pull/4840#discussion_r1511951178


##########
artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPTunneledCoreLargeMessageReaderTest.java:
##########
@@ -159,19 +169,18 @@ public void testReadMessageByteByByteFromDeliveryBuffer() 
throws Exception {
          
when(receiver.recv()).thenReturn(deliveryAnnotations.duplicate().position(i - 
1).limit(i).slice());
 
          try {
-            assertNull(reader.readBytes(delivery));
+            readMessage = null;
+            reader.readBytes(delivery);
+            Assert.assertNull(readMessage);
          } catch (IllegalStateException e) {
             fail("Should not throw as the reader should be able to read just 
delivery annotations.");
          }
       }
 
-      assertNotNull(reader.getDeliveryAnnotations());
-
-      final DeliveryAnnotations annotations = reader.getDeliveryAnnotations();
-
-      assertTrue(annotations.getValue().get(Symbol.valueOf("a")).equals("a"));
-      assertTrue(annotations.getValue().get(Symbol.valueOf("b")).equals("b"));
-      assertTrue(annotations.getValue().get(Symbol.valueOf("c")).equals("c"));
+      DeliveryAnnotations currentAnnotations = reader.getDeliveryAnnotations();

Review Comment:
   The readMethod now calls close when there's no more pending. that is the 
onMessageComplete is called and the reader is closed. Meaning the test here 
would call getDeliveryAnnotations and it wouldn't be here.
   
   
   the only case where getDeliveryAnnotations will return anything is if the 
read it still partial now.



-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to