Skip to content

Commit

Permalink
Merge pull request #10619 from MishaDemianenko/2.3-hostnameporttest
Browse files Browse the repository at this point in the history
Backport cleanup HostnamePortTest URI creation assumptions.
  • Loading branch information
MishaDemianenko committed Dec 12, 2017
2 parents 81f2f8e + 8bf2eb7 commit b9ef4e3
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@
*/
package org.neo4j.helpers;

import org.junit.Test;

import java.net.InetAddress;
import java.net.URI;
import java.net.UnknownHostException;

import org.junit.Test;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
import static org.junit.Assume.assumeFalse;
import static org.junit.Assume.assumeTrue;

public class HostnamePortTest
{
Expand Down Expand Up @@ -472,8 +472,6 @@ public void testMatchesNullHostWithUnknownHost() throws Exception
// When & Then

assertFalse( hostnamePortSinglePort.matches( URI.create( "ha://" + unknownHost + ":1234" ) ) );
// no scheme means no ports and no host, so both null therefore comparison fails
assertFalse( hostnamePortSinglePort.matches( URI.create( unknownHost + ":1234" ) ) );
}

@Test
Expand All @@ -492,8 +490,6 @@ public void testMatchesNullHostWithKnownHost() throws Exception
String host1 = InetAddress.getLocalHost().getHostName();

assertFalse( hostnamePortSinglePort.matches( URI.create( "ha://" + host1 + ":1234" ) ) );
// no scheme means no ports and no host, so both null therefore comparison fails
assertFalse( hostnamePortSinglePort.matches( URI.create( host1 + ":1234" ) ) );
}

@Test
Expand Down

0 comments on commit b9ef4e3

Please sign in to comment.