### Question:
FieldHelper { public static String getNativeDataTypeSimpleName( IValueMeta v ) { try { return v.getType() != IValueMeta.TYPE_BINARY ? v.getNativeDataTypeClass().getSimpleName() : "Binary"; } catch ( HopValueException e ) { ILogChannel log = new LogChannel( v ); log.logDebug( BaseMessages.getString( PKG, "FieldHelper.Log.UnknownNativeDataTypeSimpleName" ) ); return "Object"; } } FieldHelper( IRowMeta rowMeta, String fieldName ); Object getObject( Object[] dataRow ); @Deprecated BigDecimal getBigNumber( Object[] dataRow ); BigDecimal getBigDecimal( Object[] dataRow ); byte[] getBinary( Object[] dataRow ); Boolean getBoolean( Object[] dataRow ); Date getDate( Object[] dataRow ); @Deprecated Long getInteger( Object[] dataRow ); Long getLong( Object[] dataRow ); @Deprecated Double getNumber( Object[] dataRow ); Double getDouble( Object[] dataRow ); Timestamp getTimestamp( Object[] dataRow ); InetAddress getInetAddress( Object[] dataRow ); Serializable getSerializable( Object[] dataRow ); String getString( Object[] dataRow ); IValueMeta getValueMeta(); int indexOfValue(); void setValue( Object[] dataRow, Object value ); void setValue( Object[] dataRow, byte[] value ); static String getAccessor( boolean isIn, String fieldName ); static String getGetSignature( String accessor, IValueMeta v ); static String getNativeDataTypeSimpleName( IValueMeta v );  }### Answer:
@Test public void getNativeDataTypeSimpleName_Unknown() throws Exception { HopValueException e = new HopValueException(); IValueMeta v = mock( IValueMeta.class ); doThrow( e ).when( v ).getNativeDataTypeClass(); LogChannel log = mock( LogChannel.class ); whenNew( LogChannel.class ).withAnyArguments().thenReturn( log ); assertEquals( "Object", FieldHelper.getNativeDataTypeSimpleName( v ) ); verify( log, times( 1 ) ).logDebug( "Unable to get name from data type" ); }
@Test public void getNativeDataTypeSimpleName_String() { ValueMetaString v = new ValueMetaString(); assertEquals( "String", FieldHelper.getNativeDataTypeSimpleName( v ) ); }
@Test public void getNativeDataTypeSimpleName_InetAddress() { ValueMetaInternetAddress v = new ValueMetaInternetAddress(); assertEquals( "InetAddress", FieldHelper.getNativeDataTypeSimpleName( v ) ); }
@Test public void getNativeDataTypeSimpleName_Timestamp() { ValueMetaTimestamp v = new ValueMetaTimestamp(); assertEquals( "Timestamp", FieldHelper.getNativeDataTypeSimpleName( v ) ); }
@Test public void getNativeDataTypeSimpleName_Binary() { ValueMetaBinary v = new ValueMetaBinary(); assertEquals( "Binary", FieldHelper.getNativeDataTypeSimpleName( v ) ); }