@Test public void testEnforceProtP() throws Exception { FTPSTestConnection connection = spy( new FTPSTestConnection( FTPSConnection.CONNECTION_TYPE_FTP_IMPLICIT_TLS_WITH_CRYPTED, "the.perfect.host", 2010, "warwickw", "julia", null ) ); connection.replies.put( "PWD", new Reply( Arrays.asList( "257 \"/la\" is current directory" ) ) ); connection.connect(); connection.getFileNames(); assertEquals( "buffer not set", "PBSZ 0\r\n", connection.commands.get( 1 ).toString() ); assertEquals( "data privacy not set", "PROT P\r\n", connection.commands.get( 2 ).toString() ); }