Testing #toString of Parameters (#653)

This commit is contained in:
stefan
2020-12-12 20:00:43 +01:00
parent 9e9797c326
commit 9266b6c04a

View File

@@ -3,6 +3,7 @@ package net.schmizz.sshj.connection.channel.direct;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull; import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import java.util.HashMap; import java.util.HashMap;
@@ -93,4 +94,15 @@ public class ParametersTest {
assertNull(map.get(third)); assertNull(map.get(third));
} }
@Test
public void testToString() {
final Parameters first = new Parameters("127.0.0.1", 8080, "github.com", 443);
assertNotNull(first.toString());
assertFalse(first.toString().isBlank());
assertTrue(first.toString().contains("127.0.0.1"));
assertTrue(first.toString().contains("8080"));
assertTrue(first.toString().contains("github.com"));
assertTrue(first.toString().contains("443"));
}
} }