@Test
public void testEnforceProtPOnPut() throws Exception {
FileObject file = KettleVFS.createTempFile( "FTPSConnectionTest_testEnforceProtPOnPut", KettleVFS.Suffix.TMP);
file.createFile();
try {
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.uploadFile( file.getPublicURIString(), "uploaded-file" );
assertEquals( "buffer not set", "PBSZ 0\r\n", connection.commands.get( 0 ).toString() );
assertEquals( "data privacy not set", "PROT P\r\n", connection.commands.get( 1 ).toString() );
} finally {
file.delete();
}
}