brusdev commented on code in PR #4169:
URL: https://github.com/apache/activemq-artemis/pull/4169#discussion_r939492122


##########
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AddressControlTest.java:
##########
@@ -240,13 +240,11 @@ public void testGetRoles() throws Exception {
       Assert.assertEquals(1, roles.length);
       Object[] r = (Object[]) roles[0];
       Assert.assertEquals(role.getName(), r[0]);
-      Assert.assertEquals(CheckType.SEND.hasRole(role), r[1]);
-      Assert.assertEquals(CheckType.CONSUME.hasRole(role), r[2]);
-      Assert.assertEquals(CheckType.CREATE_DURABLE_QUEUE.hasRole(role), r[3]);
-      Assert.assertEquals(CheckType.DELETE_DURABLE_QUEUE.hasRole(role), r[4]);
-      Assert.assertEquals(CheckType.CREATE_NON_DURABLE_QUEUE.hasRole(role), 
r[5]);
-      Assert.assertEquals(CheckType.DELETE_NON_DURABLE_QUEUE.hasRole(role), 
r[6]);
-      Assert.assertEquals(CheckType.MANAGE.hasRole(role), r[7]);
+      int i = 1;
+      for (CheckType type: CheckType.values()) {

Review Comment:
   This loop scans the CheckType values in the definition order: SEND, CONSUME, 
CREATE_ADDRESS, DELETE_ADDRESS, ... .While the `getRoles` method returns roles 
in the following order: SEND, CONSUME, CREATE_DURABLE_QUEUE, 
DELETE_DURABLE_QUEUE, ...



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