diff --git a/src/main/java/org/apache/commons/net/bsd/RExecClient.java b/src/main/java/org/apache/commons/net/bsd/RExecClient.java index aaf4d5406..63961dde5 100644 --- a/src/main/java/org/apache/commons/net/bsd/RExecClient.java +++ b/src/main/java/org/apache/commons/net/bsd/RExecClient.java @@ -65,7 +65,7 @@ public class RExecClient extends SocketClient { */ public static final int DEFAULT_PORT = 512; - private boolean remoteVerificationEnabled; + private boolean remoteVerificationEnabled = true; /** * If a separate error stream is requested, {@code _errorStream_} will point to an InputStream from which the standard error of the remote process can diff --git a/src/test/java/org/apache/commons/net/bsd/RCommandClientTest.java b/src/test/java/org/apache/commons/net/bsd/RCommandClientTest.java index 00640fbbb..15b1c7055 100644 --- a/src/test/java/org/apache/commons/net/bsd/RCommandClientTest.java +++ b/src/test/java/org/apache/commons/net/bsd/RCommandClientTest.java @@ -20,6 +20,7 @@ import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import java.io.InputStream; @@ -52,4 +53,9 @@ void testGetInputStream() throws IOException { } } + @Test + void testRemoteVerificationEnabledByDefault() { + assertTrue(newClient().isRemoteVerificationEnabled()); + } + } diff --git a/src/test/java/org/apache/commons/net/bsd/RExecClientTest.java b/src/test/java/org/apache/commons/net/bsd/RExecClientTest.java index cac9781bc..d1dc70e24 100644 --- a/src/test/java/org/apache/commons/net/bsd/RExecClientTest.java +++ b/src/test/java/org/apache/commons/net/bsd/RExecClientTest.java @@ -20,6 +20,7 @@ import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import java.io.InputStream; @@ -67,4 +68,9 @@ void testGetOutputStream() throws IOException { } } + @Test + void testRemoteVerificationEnabledByDefault() { + assertTrue(newClient().isRemoteVerificationEnabled()); + } + } diff --git a/src/test/java/org/apache/commons/net/bsd/RLoginClientTest.java b/src/test/java/org/apache/commons/net/bsd/RLoginClientTest.java index e0212a45d..62eb7c122 100644 --- a/src/test/java/org/apache/commons/net/bsd/RLoginClientTest.java +++ b/src/test/java/org/apache/commons/net/bsd/RLoginClientTest.java @@ -20,6 +20,7 @@ import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import java.io.InputStream; @@ -52,4 +53,9 @@ void testGetInputStream() throws IOException { } } + @Test + void testRemoteVerificationEnabledByDefault() { + assertTrue(newClient().isRemoteVerificationEnabled()); + } + }