ARTEMIS-4209 avoid double 'ID:' for 'User ID' when browsing AMQP msgs
This commit is contained in:
parent
d2e5ddfe86
commit
448a6dee02
|
@ -127,7 +127,8 @@ public class MessageOpenTypeFactory<M extends Message> {
|
||||||
rc.put(CompositeDataConstants.MESSAGE_ID, "" + m.getMessageID());
|
rc.put(CompositeDataConstants.MESSAGE_ID, "" + m.getMessageID());
|
||||||
rc.put(CompositeDataConstants.PROTOCOL, m.getProtocolName());
|
rc.put(CompositeDataConstants.PROTOCOL, m.getProtocolName());
|
||||||
if (m.getUserID() != null) {
|
if (m.getUserID() != null) {
|
||||||
rc.put(CompositeDataConstants.USER_ID, "ID:" + m.getUserID().toString());
|
String userID = m.getUserID().toString();
|
||||||
|
rc.put(CompositeDataConstants.USER_ID, userID.startsWith("ID:") ? userID : "ID:" + userID);
|
||||||
} else {
|
} else {
|
||||||
rc.put(CompositeDataConstants.USER_ID, "");
|
rc.put(CompositeDataConstants.USER_ID, "");
|
||||||
}
|
}
|
||||||
|
|
|
@ -4090,12 +4090,24 @@ public class QueueControlTest extends ManagementTestBase {
|
||||||
|
|
||||||
Assert.assertEquals(2, browse.length);
|
Assert.assertEquals(2, browse.length);
|
||||||
|
|
||||||
|
String userID = (String) browse[0].get("userID");
|
||||||
|
|
||||||
|
Assert.assertTrue(userID.startsWith("ID:"));
|
||||||
|
|
||||||
|
Assert.assertFalse(userID.startsWith("ID:ID:"));
|
||||||
|
|
||||||
String body = (String) browse[0].get("text");
|
String body = (String) browse[0].get("text");
|
||||||
|
|
||||||
Assert.assertNotNull(body);
|
Assert.assertNotNull(body);
|
||||||
|
|
||||||
Assert.assertEquals("theAMQPBody", body);
|
Assert.assertEquals("theAMQPBody", body);
|
||||||
|
|
||||||
|
userID = (String) browse[1].get("userID");
|
||||||
|
|
||||||
|
Assert.assertTrue(userID.startsWith("ID:"));
|
||||||
|
|
||||||
|
Assert.assertFalse(userID.startsWith("ID:ID:"));
|
||||||
|
|
||||||
body = (String) browse[1].get("text");
|
body = (String) browse[1].get("text");
|
||||||
|
|
||||||
Assert.assertNotNull(body);
|
Assert.assertNotNull(body);
|
||||||
|
|
Loading…
Reference in New Issue