@@ -57,7 +57,7 @@ public class ConnectionRecovery extends BrokerTestCase {
5757
5858 @ Test public void namedConnectionRecovery ()
5959 throws IOException , InterruptedException , TimeoutException {
60- String connectionName = "custom name" ;
60+ String connectionName = "custom- name" ;
6161 RecoverableConnection c = newRecoveringConnection (connectionName );
6262 try {
6363 assertThat (c .isOpen ()).isTrue ();
@@ -151,7 +151,7 @@ public String getPassword() {
151151 return password ;
152152 }
153153 });
154- RecoverableConnection c = (RecoverableConnection ) cf .newConnection ();
154+ RecoverableConnection c = (RecoverableConnection ) cf .newConnection (UUID . randomUUID (). toString () );
155155 try {
156156 assertThat (c .isOpen ()).isTrue ();
157157 assertThat (usernameRequested .get ()).isEqualTo (1 );
@@ -802,7 +802,7 @@ public void handleDelivery(String consumerTag,
802802 @ Test public void recoveryWithExponentialBackoffDelayHandler () throws Exception {
803803 ConnectionFactory connectionFactory = TestUtils .connectionFactory ();
804804 connectionFactory .setRecoveryDelayHandler (new RecoveryDelayHandler .ExponentialBackoffDelayHandler ());
805- Connection testConnection = connectionFactory .newConnection ();
805+ Connection testConnection = connectionFactory .newConnection (UUID . randomUUID (). toString () );
806806 try {
807807 assertThat (testConnection .isOpen ()).isTrue ();
808808 TestUtils .closeAndWaitForRecovery ((RecoverableConnection ) testConnection );
@@ -820,7 +820,9 @@ public void handleDelivery(String consumerTag,
820820 assertThat (connectionFactory .getTopologyRecoveryExecutor ()).isNull ();
821821 connectionFactory .setTopologyRecoveryExecutor (executor );
822822 assertThat (connectionFactory .getTopologyRecoveryExecutor ()).isEqualTo (executor );
823- RecoverableConnection testConnection = (RecoverableConnection ) connectionFactory .newConnection ();
823+ RecoverableConnection testConnection = (RecoverableConnection ) connectionFactory .newConnection (
824+ UUID .randomUUID ().toString ()
825+ );
824826 try {
825827 final List <Channel > channels = new ArrayList <Channel >();
826828 final List <String > exchanges = new ArrayList <String >();
@@ -975,20 +977,20 @@ protected ConnectionFactory newConnectionFactory() {
975977 private static RecoverableConnection newRecoveringConnection (boolean disableTopologyRecovery )
976978 throws IOException , TimeoutException {
977979 ConnectionFactory cf = buildConnectionFactoryWithRecoveryEnabled (disableTopologyRecovery );
978- return (AutorecoveringConnection ) cf .newConnection ();
980+ return (AutorecoveringConnection ) cf .newConnection (UUID . randomUUID (). toString () );
979981 }
980982
981983 private static RecoverableConnection newRecoveringConnection (Address [] addresses )
982984 throws IOException , TimeoutException {
983985 ConnectionFactory cf = buildConnectionFactoryWithRecoveryEnabled (false );
984986 // specifically use the Address[] overload
985- return (AutorecoveringConnection ) cf .newConnection (addresses );
987+ return (AutorecoveringConnection ) cf .newConnection (addresses , UUID . randomUUID (). toString () );
986988 }
987989
988990 private static RecoverableConnection newRecoveringConnection (boolean disableTopologyRecovery , List <Address > addresses )
989991 throws IOException , TimeoutException {
990992 ConnectionFactory cf = buildConnectionFactoryWithRecoveryEnabled (disableTopologyRecovery );
991- return (AutorecoveringConnection ) cf .newConnection (addresses );
993+ return (AutorecoveringConnection ) cf .newConnection (addresses , UUID . randomUUID (). toString () );
992994 }
993995
994996 private static RecoverableConnection newRecoveringConnection (List <Address > addresses )
0 commit comments