jbertram commented on code in PR #6050:
URL: https://github.com/apache/activemq-artemis/pull/6050#discussion_r2519025572
##########
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/MessageRedistributionTest.java:
##########
@@ -1328,6 +1332,54 @@ public void
testRedistributionToQueuesWhereNotAllMessagesMatch() throws Exceptio
verifyReceiveAllInRange(10, 20, 2);
}
+ @Test
+ public void testValidatedUserWithRedistribution() throws Exception {
+ final String USERNAME = "myUser";
+ final String PASSWORD = "myPass";
+ final String ROLE = "myRole";
+ SecurityConfiguration securityConfiguration = new
SecurityConfiguration();
+ securityConfiguration.addUser(USERNAME, PASSWORD);
+ securityConfiguration.addRole(USERNAME, ROLE);
+ ActiveMQJAASSecurityManager securityManager = new
ActiveMQJAASSecurityManager(InVMLoginModule.class.getName(),
securityConfiguration);
+ servers[0].getConfiguration()
+ .setPopulateValidatedUser(true)
+ .setSecurityEnabled(true);
+ servers[0].setSecurityManager(securityManager);
+ servers[1].getConfiguration()
+ .setPopulateValidatedUser(true)
+ .setSecurityEnabled(true);
+ servers[1].setSecurityManager(securityManager);
+ setupCluster(MessageLoadBalancingType.ON_DEMAND);
+
+ startServers(0, 1);
+
+ Role role = new Role(ROLE, true, true, true, true, true, true, true,
true, true, true, false, false);
+ Set<Role> roles = new HashSet<>();
+ roles.add(role);
+ servers[0].getSecurityRepository().addMatch("#", roles);
+ servers[1].getSecurityRepository().addMatch("#", roles);
+
+ setupSessionFactory(0, isNetty(), false, USERNAME, PASSWORD);
+ setupSessionFactory(1, isNetty(), false, USERNAME, PASSWORD);
+
+ createQueue(0, "queues.testaddress", "queue0", null, false, USERNAME,
PASSWORD);
+ createQueue(1, "queues.testaddress", "queue0", null, false, USERNAME,
PASSWORD);
+
+ waitForBindings(0, "queues.testaddress", 1, 0, true);
+ waitForBindings(1, "queues.testaddress", 1, 0, true);
+
+ waitForBindings(0, "queues.testaddress", 1, 0, false);
+ waitForBindings(1, "queues.testaddress", 1, 0, false);
+
+ send(0, "queues.testaddress", 1, false, null, USERNAME, PASSWORD);
+
+ addConsumer(1, 1, "queue0", null, true, USERNAME, PASSWORD);
+
+ ClientMessage m = consumers[1].consumer.receive();
Review Comment:
Hmmm...Perhaps not. Most of the other explicit calls to `receive(int)` are
using `5000` or `1000` so I'll use `1000` as well.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact