@@ -33,6 +33,14 @@ public void testDefault() throws UnknownHostException {
33
33
assertEquals (ServerAddress .defaultPort (), subject .getPort ());
34
34
}
35
35
36
+ @ Test
37
+ public void testLowerCaseHostName () throws UnknownHostException {
38
+ final String capitalizedHostName = "SOMEWHERE" ;
39
+ ServerAddress subject = new ServerAddress (capitalizedHostName );
40
+
41
+ assertEquals (capitalizedHostName .toLowerCase (), subject .getHost ());
42
+ }
43
+
36
44
@ Test
37
45
public void testParseIPV4WithoutPort () throws UnknownHostException {
38
46
ServerAddress subject = new ServerAddress ("10.0.0.1" );
@@ -69,23 +77,23 @@ public void testParseDnsNameWithoutPort() throws UnknownHostException {
69
77
public void testParseIPV6WithoutPort () throws UnknownHostException {
70
78
ServerAddress subject = new ServerAddress ("[2010:836B:4179::836B:4179]" );
71
79
72
- assertEquals ("2010:836B :4179::836B :4179" , subject .getHost ());
80
+ assertEquals ("2010:836b :4179::836b :4179" , subject .getHost ());
73
81
assertEquals (ServerAddress .defaultPort (), subject .getPort ());
74
82
}
75
83
76
84
@ Test
77
85
public void testParseIPV6WithPort () throws UnknownHostException {
78
86
ServerAddress subject = new ServerAddress ("[2010:836B:4179::836B:4179]:1000" );
79
87
80
- assertEquals ("2010:836B :4179::836B :4179" , subject .getHost ());
88
+ assertEquals ("2010:836b :4179::836b :4179" , subject .getHost ());
81
89
assertEquals (1000 , subject .getPort ());
82
90
}
83
91
84
92
@ Test
85
93
public void testIPV6WithPort () throws UnknownHostException {
86
94
ServerAddress subject = new ServerAddress ("[2010:836B:4179::836B:4179]" , 1000 );
87
95
88
- assertEquals ("2010:836B :4179::836B :4179" , subject .getHost ());
96
+ assertEquals ("2010:836b :4179::836b :4179" , subject .getHost ());
89
97
assertEquals (1000 , subject .getPort ());
90
98
}
91
99
0 commit comments