CompositeData compositeData = URISupport.parseComposite(uri);
StubCompositeTransport compositeTransport = new StubCompositeTransport();
DiscoveryTransport discoveryTransport = DiscoveryTransportFactory.createTransport(compositeTransport, compositeData, compositeData.getParameters());
discoveryTransport.onServiceAdd(new DiscoveryEvent("tcp://localhost:61616"));
assertEquals("expected added URI after discovery event", compositeTransport.getTransportURIs().length, 1);
URI discoveredServiceURI = compositeTransport.getTransportURIs()[0];
Map<String, String> parameters = URISupport.parseParameters(discoveredServiceURI);
assertTrue("unable to add parameter to discovered service", parameters.containsKey(extraParameterName));