@@ -33,6 +33,14 @@ public void testDefault() throws UnknownHostException {
3333 assertEquals (ServerAddress .defaultPort (), subject .getPort ());
3434 }
3535
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+
3644 @ Test
3745 public void testParseIPV4WithoutPort () throws UnknownHostException {
3846 ServerAddress subject = new ServerAddress ("10.0.0.1" );
@@ -69,23 +77,23 @@ public void testParseDnsNameWithoutPort() throws UnknownHostException {
6977 public void testParseIPV6WithoutPort () throws UnknownHostException {
7078 ServerAddress subject = new ServerAddress ("[2010:836B:4179::836B:4179]" );
7179
72- assertEquals ("2010:836B :4179::836B :4179" , subject .getHost ());
80+ assertEquals ("2010:836b :4179::836b :4179" , subject .getHost ());
7381 assertEquals (ServerAddress .defaultPort (), subject .getPort ());
7482 }
7583
7684 @ Test
7785 public void testParseIPV6WithPort () throws UnknownHostException {
7886 ServerAddress subject = new ServerAddress ("[2010:836B:4179::836B:4179]:1000" );
7987
80- assertEquals ("2010:836B :4179::836B :4179" , subject .getHost ());
88+ assertEquals ("2010:836b :4179::836b :4179" , subject .getHost ());
8189 assertEquals (1000 , subject .getPort ());
8290 }
8391
8492 @ Test
8593 public void testIPV6WithPort () throws UnknownHostException {
8694 ServerAddress subject = new ServerAddress ("[2010:836B:4179::836B:4179]" , 1000 );
8795
88- assertEquals ("2010:836B :4179::836B :4179" , subject .getHost ());
96+ assertEquals ("2010:836b :4179::836b :4179" , subject .getHost ());
8997 assertEquals (1000 , subject .getPort ());
9098 }
9199
0 commit comments