Skip to content

Commit

Permalink
Replace Location.location() with toString()
Browse files Browse the repository at this point in the history
  • Loading branch information
electrum committed May 3, 2023
1 parent cd4d618 commit 9c401ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,6 @@ private Location withPath(String location, String path)
return new Location(location, scheme, userInfo, host, port, path);
}

public String location()
{
return location;
}

/**
* Returns the scheme of the location, if present.
* If the scheme is present, the value will not be an empty string.
Expand Down Expand Up @@ -287,6 +282,9 @@ public int hashCode()
return location.hashCode();
}

/**
* Return the original location string.
*/
@Override
public String toString()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ private static void assertLocation(String locationString, String path)

private static void assertLocation(Location actual, Location expected)
{
assertLocation(actual, expected.location(), expected.scheme(), expected.userInfo(), expected.host(), expected.port(), expected.path());
assertLocation(actual, expected.toString(), expected.scheme(), expected.userInfo(), expected.host(), expected.port(), expected.path());
}

private static void assertLocation(Location location, String locationString, Optional<String> scheme, Optional<String> userInfo, Optional<String> host, OptionalInt port, String path)
{
assertThat(location.location()).isEqualTo(locationString);
assertThat(location.toString()).isEqualTo(locationString);
assertThat(location.scheme()).isEqualTo(scheme);
assertThat(location.userInfo()).isEqualTo(userInfo);
assertThat(location.host()).isEqualTo(host);
Expand Down

0 comments on commit 9c401ff

Please sign in to comment.