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