### Question:
CreditCardValidatorMeta extends BaseTransformMeta implements ITransformMeta<CreditCardValidator, CreditCardValidatorData> { public void getFields( IRowMeta inputRowMeta, String name, IRowMeta[] info, TransformMeta nextTransform, IVariables variables, IHopMetadataProvider metadataProvider ) throws HopTransformException { String realresultfieldname = variables.environmentSubstitute( resultfieldname ); if ( !Utils.isEmpty( realresultfieldname ) ) { IValueMeta v = new ValueMetaBoolean( realresultfieldname ); v.setOrigin( name ); inputRowMeta.addValueMeta( v ); } String realcardtype = variables.environmentSubstitute( cardtype ); if ( !Utils.isEmpty( realcardtype ) ) { IValueMeta v = new ValueMetaString( realcardtype ); v.setOrigin( name ); inputRowMeta.addValueMeta( v ); } String realnotvalidmsg = variables.environmentSubstitute( notvalidmsg ); if ( !Utils.isEmpty( notvalidmsg ) ) { IValueMeta v = new ValueMetaString( realnotvalidmsg ); v.setOrigin( name ); inputRowMeta.addValueMeta( v ); } } CreditCardValidatorMeta(); String getDynamicField(); void setDynamicField( String fieldname ); String getResultFieldName(); void setOnlyDigits( boolean onlydigits ); boolean isOnlyDigits(); void setResultFieldName( String resultfieldname ); void setCardType( String cardtype ); String getCardType(); void setNotValidMsg( String notvalidmsg ); String getNotValidMsg(); void loadXml( Node transformNode, IHopMetadataProvider metadataProvider ); Object clone(); void setDefault(); void getFields( IRowMeta inputRowMeta, String name, IRowMeta[] info, TransformMeta nextTransform,
                         IVariables variables, IHopMetadataProvider metadataProvider ); String getXml(); void check( List<ICheckResult> remarks, PipelineMeta pipelineMeta, TransformMeta transformMeta,
                     IRowMeta prev, String[] input, String[] output, IRowMeta info, IVariables variables,
                     IHopMetadataProvider metadataProvider ); CreditCardValidator createTransform( TransformMeta transformMeta, CreditCardValidatorData data, int cnr,
                                              PipelineMeta pipelineMeta, Pipeline pipeline ); CreditCardValidatorData getTransformData(); boolean supportsErrorHandling();  }### Answer:
@Test public void testGetFields() throws HopTransformException { CreditCardValidatorMeta meta = new CreditCardValidatorMeta(); meta.setDefault(); meta.setResultFieldName( "The Result Field" ); meta.setCardType( "The Card Type Field" ); meta.setNotValidMsg( "Is Card Valid" ); RowMeta rowMeta = new RowMeta(); meta.getFields( rowMeta, "this transform", null, null, new Variables(), null ); assertEquals( 3, rowMeta.size() ); assertEquals( "The Result Field", rowMeta.getValueMeta( 0 ).getName() ); assertEquals( IValueMeta.TYPE_BOOLEAN, rowMeta.getValueMeta( 0 ).getType() ); assertEquals( "this transform", rowMeta.getValueMeta( 0 ).getOrigin() ); assertEquals( "The Card Type Field", rowMeta.getValueMeta( 1 ).getName() ); assertEquals( IValueMeta.TYPE_STRING, rowMeta.getValueMeta( 1 ).getType() ); assertEquals( "this transform", rowMeta.getValueMeta( 1 ).getOrigin() ); assertEquals( "Is Card Valid", rowMeta.getValueMeta( 2 ).getName() ); assertEquals( IValueMeta.TYPE_STRING, rowMeta.getValueMeta( 2 ).getType() ); assertEquals( "this transform", rowMeta.getValueMeta( 2 ).getOrigin() ); }