Github user cshannon commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/2116#discussion_r191787441
--- Diff:
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/SessionMetadataAddExceptionTest.java
---
@@ -75,6 +88,24 @@ public void testInvalidClientIdSetFactory() throws
Exception {
cf.createConnection();
}
+ @Test(timeout = 5000, expected = JMSException.class)
+ public void testDuplicateClientIdSet() throws Exception {
+ ActiveMQConnectionFactory activeMQConnectionFactory =
(ActiveMQConnectionFactory) cf;
+ Connection con = cf.createConnection();
+ Connection con2 = cf.createConnection();
+ try {
+ con.setClientID("valid");
+ con2.setClientID("valid");
+ fail("Should have failed for duplicate clientId");
+ } catch (Exception e) {
--- End diff --
I switched it to catch the InvalidClientIdException that gets thrown
---