@@ -24,8 +24,9 @@ class ServerAddressSpecification extends Specification {
24
24
@Unroll
25
25
def ' constructors should parse hostname and port correctly' () {
26
26
expect :
27
- address. getHost() == host;
28
- address. getPort() == port;
27
+ address. getHost() == host
28
+ address. getPort() == port
29
+ address == new ServerAddress (host, port)
29
30
30
31
where :
31
32
address | host | port
@@ -37,10 +38,11 @@ class ServerAddressSpecification extends Specification {
37
38
new ServerAddress (' SOMEWHERE' ) | ' somewhere' | ServerAddress . defaultPort()
38
39
new ServerAddress (' somewhere:1000' ) | ' somewhere' | 1000
39
40
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
44
46
}
45
47
46
48
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 {
92
94
then :
93
95
thrown(MongoException );
94
96
}
95
- }
97
+ }
0 commit comments