### Question:
HttpPostMeta extends BaseTransformMeta implements ITransformMeta<HttpPost, HttpPostData> { public void setDefault() { int i; int nrargs; nrargs = 0; allocate( nrargs ); for ( i = 0; i < nrargs; i++ ) { argumentField[ i ] = "arg" + i; argumentParameter[ i ] = "arg"; argumentHeader[ i ] = false; } int nrquery; nrquery = 0; allocateQuery( nrquery ); for ( i = 0; i < nrquery; i++ ) { queryField[ i ] = "query" + i; queryParameter[ i ] = "query"; } fieldName = "result"; resultCodeFieldName = ""; responseTimeFieldName = ""; responseHeaderFieldName = ""; encoding = DEFAULT_ENCODING; postafile = false; socketTimeout = String.valueOf( DEFAULT_SOCKET_TIMEOUT ); connectionTimeout = String.valueOf( DEFAULT_CONNECTION_TIMEOUT ); closeIdleConnectionsTime = String.valueOf( DEFAULT_CLOSE_CONNECTIONS_TIME ); } HttpPostMeta(); String getEncoding(); void setEncoding( String encoding ); String[] getArgumentField(); void setArgumentField( String[] argument ); String[] getQueryField(); void setQueryField( String[] queryfield ); String getConnectionTimeout(); void setConnectionTimeout( String connectionTimeout ); String getCloseIdleConnectionsTime(); void setCloseIdleConnectionsTime( String closeIdleConnectionsTime ); String getSocketTimeout(); void setSocketTimeout( String socketTimeout ); String[] getArgumentParameter(); void setArgumentParameter( String[] argumentDirection ); String[] getQueryParameter(); void setQueryParameter( String[] queryParameter ); String getUrl(); void setUrl( String procedure ); boolean isUrlInField(); boolean isPostAFile(); void setPostAFile( boolean postafile ); void setUrlInField( boolean urlInField ); String getUrlField(); void setUrlField( String urlField ); void setRequestEntity( String requestEntity ); String getRequestEntity(); String getFieldName(); void setFieldName( String resultName ); void loadXml( Node transformNode, IHopMetadataProvider metadataProvider ); void allocate( int nrargs ); void allocateQuery( int nrqueryparams ); 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 ); HttpPost createTransform( TransformMeta transformMeta, HttpPostData data, int cnr,
                                   PipelineMeta pipelineMeta, Pipeline pipeline ); HttpPostData getTransformData(); boolean supportsErrorHandling(); boolean[] getArgumentHeader(); void setArgumentHeader( boolean[] argumentHeader ); String getResultCodeFieldName(); void setResultCodeFieldName( String resultCodeFieldName ); void setProxyHost( String proxyHost ); String getProxyHost(); void setProxyPort( String proxyPort ); String getProxyPort(); void setHttpLogin( String httpLogin ); String getHttpLogin(); void setHttpPassword( String httpPassword ); String getHttpPassword(); String getResponseTimeFieldName(); void setResponseTimeFieldName( String responseTimeFieldName ); String getResponseHeaderFieldName(); void setResponseHeaderFieldName( String responseHeaderFieldName ); static final int DEFAULT_SOCKET_TIMEOUT; static final int DEFAULT_CONNECTION_TIMEOUT; static final int DEFAULT_CLOSE_CONNECTIONS_TIME; static final String DEFAULT_ENCODING; }### Answer:
@Test public void setDefault() { HttpPostMeta meta = new HttpPostMeta(); assertNull( meta.getEncoding() ); meta.setDefault(); assertEquals( "UTF-8", meta.getEncoding() ); }