ARTEMIS-3677 add test, etc.

This commit is contained in:
Justin Bertram 2022-02-10 11:25:20 -06:00
parent d2e31a6b3f
commit 7b25cbb51d
No known key found for this signature in database
GPG Key ID: F41830B875BB8633
2 changed files with 21 additions and 1 deletions

View File

@ -1410,7 +1410,7 @@ public class CoreMessage extends RefCountMessage implements ICoreMessage {
rc.put(CompositeDataConstants.TEXT_BODY, "[compressed]");
} else {
SimpleString text = m.getReadOnlyBodyBuffer().readNullableSimpleString();
rc.put(CompositeDataConstants.TEXT_BODY, text != null ? JsonUtil.truncate(text.toString(), valueSizeLimit) : "");
rc.put(CompositeDataConstants.TEXT_BODY, JsonUtil.truncate(text != null ? text.toString() : text, valueSizeLimit));
}
} else {
rc.put(CompositeDataConstants.TEXT_BODY, "[large message]");

View File

@ -3729,6 +3729,26 @@ public class QueueControlTest extends ManagementTestBase {
session.deleteQueue(queue);
}
@Test
public void testBrowseWithNullPropertyValue() throws Exception {
SimpleString address = RandomUtil.randomSimpleString();
SimpleString queue = RandomUtil.randomSimpleString();
session.createQueue(new QueueConfiguration(queue).setAddress(address).setDurable(durable));
ClientProducer producer = session.createProducer(address);
ClientMessage m = session.createMessage(true);
m.putStringProperty(RandomUtil.randomString(), null);
producer.send(m);
producer.close();
QueueControl queueControl = createManagementControl(address, queue);
assertEquals(1, queueControl.browse().length);
session.deleteQueue(queue);
}
@Test
public void testResetGroups() throws Exception {
SimpleString address = RandomUtil.randomSimpleString();