@@ -24,8 +24,9 @@ class ServerAddressSpecification extends Specification {
2424 @Unroll
2525 def ' constructors should parse hostname and port correctly' () {
2626 expect :
27- address. getHost() == host;
28- address. getPort() == port;
27+ address. getHost() == host
28+ address. getPort() == port
29+ address == new ServerAddress (host, port)
2930
3031 where :
3132 address | host | port
@@ -37,10 +38,11 @@ class ServerAddressSpecification extends Specification {
3738 new ServerAddress (' SOMEWHERE' ) | ' somewhere' | ServerAddress . defaultPort()
3839 new ServerAddress (' somewhere:1000' ) | ' somewhere' | 1000
3940 new ServerAddress (' somewhere' , 1000 ) | ' somewhere' | 1000
40- new ServerAddress (' [2010:836b:4179::836b:4179]' ) | ' [2010:836b:4179::836b:4179]' | ServerAddress . defaultPort()
41- new ServerAddress (' [2010:836B:4179::836B:4179]' ) | ' [2010:836b:4179::836b:4179]' | ServerAddress . defaultPort()
42- new ServerAddress (' [2010:836B:4179::836B:4179]:1000' ) | ' [2010:836b:4179::836b:4179]' | 1000
43- new ServerAddress (' [2010:836B:4179::836B:4179]' , 1000 ) | ' [2010:836b:4179::836b:4179]' | 1000
41+ new ServerAddress (' [2010:836B:4179::836B:4179]' ) | ' 2010:836b:4179::836b:4179' | ServerAddress . defaultPort()
42+ new ServerAddress (' [2010:836B:4179::836B:4179]:1000' ) | ' 2010:836b:4179::836b:4179' | 1000
43+ new ServerAddress (' [2010:836B:4179::836B:4179]' , 1000 ) | ' 2010:836b:4179::836b:4179' | 1000
44+ new ServerAddress (' 2010:836B:4179::836B:4179' ) | ' 2010:836b:4179::836b:4179' | ServerAddress . defaultPort()
45+ new ServerAddress (' 2010:836B:4179::836B:4179' , 1000 ) | ' 2010:836b:4179::836b:4179' | 1000
4446 }
4547
4648 def ' ipv4 host with a port specified should throw when a port is also specified as an argument' () {
@@ -92,4 +94,4 @@ class ServerAddressSpecification extends Specification {
9294 then :
9395 thrown(MongoException );
9496 }
95- }
97+ }
0 commit comments