clebertsuconic commented on code in PR #4840:
URL: https://github.com/apache/activemq-artemis/pull/4840#discussion_r1511954720
##########
artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPTunneledCoreLargeMessageReaderTest.java:
##########
@@ -116,21 +128,19 @@ public void
testReadDeliveryAnnotationsFromDeliveryBuffer() throws Exception {
reader.open();
- assertNull(reader.getDeliveryAnnotations());
-
try {
+ readMessage = null;
reader.readBytes(delivery);
+ Assert.assertNull(readMessage); // should not been called yet
} 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"));
+ // peek current delivery annotations
+ 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]