public static final String URL = "amqp://guest:guest@clientID/test?brokerlist='tcp://localhost:5672'";
public static final String URL_STAR_PWD = "amqp://guest:********@clientID/test?brokerlist='tcp://localhost:5672'";
public void testConnectionURLStringMasksPassword() throws Exception
{
AMQConnectionFactory factory = new AMQConnectionFactory(URL);
//URL will be returned with the password field swapped for '********'
assertEquals("Connection URL not correctly set", URL_STAR_PWD, factory.getConnectionURLString());
// Further test that the processed ConnectionURL is as expected after
// the set call
ConnectionURL connectionurl = factory.getConnectionURL();
assertNull("Failover is set.", connectionurl.getFailoverMethod());
assertEquals("guest", connectionurl.getUsername());
assertEquals("guest", connectionurl.getPassword());
assertEquals("clientID", connectionurl.getClientName());