### Question:
HttpPost extends BaseTransform<HttpPostMeta, HttpPostData> implements ITransform<HttpPostMeta, HttpPostData> { @VisibleForTesting String getRequestBodyParamsAsStr( NameValuePair[] pairs, String charset ) throws HopException { StringBuffer buf = new StringBuffer(); try { for ( int i = 0; i < pairs.length; ++i ) { NameValuePair pair = pairs[ i ]; if ( pair.getName() != null ) { if ( i > 0 ) { buf.append( "&" ); } buf.append( URLEncoder.encode( pair.getName(), !StringUtil.isEmpty( charset ) ? charset : DEFAULT_ENCODING ) ); buf.append( "=" ); if ( pair.getValue() != null ) { buf.append( URLEncoder.encode( pair.getValue(), !StringUtil.isEmpty( charset ) ? charset : DEFAULT_ENCODING ) ); } } } return buf.toString(); } catch ( UnsupportedEncodingException e ) { throw new HopException( e.getMessage(), e.getCause() ); } } HttpPost( TransformMeta transformMeta, HttpPostMeta meta, HttpPostData data,
                   int copyNr, PipelineMeta pipelineMeta, Pipeline pipeline ); boolean processRow(); boolean init();  }### Answer:
@Test public void getRequestBodyParametersAsStringWithNullEncoding() throws HopException { HttpPost http = mock( HttpPost.class ); doCallRealMethod().when( http ).getRequestBodyParamsAsStr( any( NameValuePair[].class ), anyString() ); NameValuePair[] pairs = new NameValuePair[] { new BasicNameValuePair( "u", "usr" ), new BasicNameValuePair( "p", "pass" ) }; assertEquals( "u=usr&p=pass", http.getRequestBodyParamsAsStr( pairs, null ) ); }