### Question:
SftpPut extends BaseTransform implements ITransform { @VisibleForTesting void checkRemoteFilenameField( String remoteFilenameFieldName, SFTPPutData data ) throws HopTransformException { remoteFilenameFieldName = environmentSubstitute( remoteFilenameFieldName ); if ( !Utils.isEmpty( remoteFilenameFieldName ) ) { data.indexOfRemoteFilename = getInputRowMeta().indexOfValue( remoteFilenameFieldName ); if ( data.indexOfRemoteFilename == -1 ) { throw new HopTransformException( BaseMessages.getString( PKG, "SFTPPut.Error.CanNotFindField", remoteFilenameFieldName ) ); } } } SftpPut(TransformMeta transformMeta, ITransformData data, int copyNr, PipelineMeta pipelineMeta,
                 Pipeline pipeline ); boolean processRow(); void dispose();  }### Answer:
@Test public void checkRemoteFilenameField_FieldNameIsBlank() throws Exception { SFTPPutData data = new SFTPPutData(); transform.checkRemoteFilenameField( "", data ); assertEquals( -1, data.indexOfSourceFileFieldName ); }
@Test( expected = HopTransformException.class ) public void checkRemoteFilenameField_FieldNameIsSet_NotFound() throws Exception { transform.setInputRowMeta( new RowMeta() ); transform.checkRemoteFilenameField( "remoteFileName", new SFTPPutData() ); }
@Test public void checkRemoteFilenameField_FieldNameIsSet_Found() throws Exception { RowMeta rowMeta = rowOfStringsMeta( "some field", "remoteFileName" ); transform.setInputRowMeta( rowMeta ); SFTPPutData data = new SFTPPutData(); transform.checkRemoteFilenameField( "remoteFileName", data ); assertEquals( 1, data.indexOfRemoteFilename ); }