Fix broken I2PSocketEepGet test, add additional case

Broken in 49d33fa03636041c4da35476539a3b6aa318da11 by the move from URL to URI.
If URI is passed a URL with a negative port, URI.getHost() returns null, which
bypasses the coercion-to-80. Zero, OTOH, is still coerced.
This commit is contained in:
str4d
2017-12-03 18:17:44 +00:00
parent 5a3f0163b9
commit bb38e07e2a

View File

@@ -117,8 +117,14 @@ public class I2PSocketEepGetTest {
@Test
public void testFetch_negPort() {
// Fails, because URI is stricter than URL
fetchFrom("http://" + STATS_HOST + ":-1", false);
}
@Test
public void testFetch_zeroPort() {
// Gets rewritten to 80
fetchFrom("http://" + STATS_HOST + ":-1", true);
fetchFrom("http://" + STATS_HOST + ":0", true);
}
@Test