Incorrect MongoDB URI in ReplicaSetDefaultWriteConcernIT
@@ -135,13 +135,16 @@ public class MongodProcessFactory extends ExternalResource {
}
static String localhost(Iterable<Integer> ports) {
- String portsString = Joiner.on(',').join(ports);
String host = InetAddress.getLoopbackAddress().getHostAddress();
- if (!portsString.isEmpty()) {
- host += ":" + portsString;
+ List<String> portsWithHost = new ArrayList<>();
+ for (int p : ports) {
+ portsWithHost.add(host + ":" + p);
}
+ if (portsWithHost.isEmpty()) {
return host;
}
+ return Joiner.on(',').join(portsWithHost);
+ }
//----------------------------< internal >----------------------------------
