TransportConfiguration implements Serializable { @Override public String toString() { StringBuilder str = new StringBuilder(TransportConfiguration.class.getSimpleName()); str.append("(name=" + name + ", "); str.append("factory=" + replaceWildcardChars(factoryClassName)); str.append(") "); str.append(toStringParameters(params, extraProps)); return str.toString(); } TransportConfiguration();  TransportConfiguration(final String className, final Map<String, Object> params, final String name);  TransportConfiguration(final String className,
                                 final Map<String, Object> params,
                                 final String name,
                                 final Map<String, Object> extraProps);  TransportConfiguration(final String className, final Map<String, Object> params);  TransportConfiguration(final String className); JsonObject toJson(); static String[] splitHosts(final String commaSeparatedHosts); TransportConfiguration newTransportConfig(String newName); String getName(); String getFactoryClassName(); Map<String, Object> getParams(); Map<String, Object> getExtraParams(); Map<String, Object> getCombinedParams(); @Override int hashCode(); @Override boolean equals(Object o); boolean isSameParams(TransportConfiguration that); boolean isEquivalent(TransportConfiguration otherConfig); @Override String toString(); static String toStringParameters(Map<String, Object> params, Map<String, Object> extraProps); void encode(final ActiveMQBuffer buffer); void decode(final ActiveMQBuffer buffer); void setFactoryClassName(String factoryClassName);  }
@Test public void testToStringObfuscatesPasswords() { HashMap<String, Object> params = new HashMap<>(); params.put(TransportConstants.TRUSTSTORE_PASSWORD_PROP_NAME, "secret_password"); params.put(TransportConstants.KEYSTORE_PASSWORD_PROP_NAME, "secret_password"); TransportConfiguration configuration = new TransportConfiguration("SomeClass", params, null); Assert.assertThat(configuration.toString(), not(containsString("secret_password"))); }