### Question:
WebService extends BaseStep implements StepInterface { static String getLocationFrom( HttpPost method ) { Header locationHeader = method.getFirstHeader( "Location" ); return locationHeader.getValue(); } WebService( StepMeta aStepMeta, StepDataInterface aStepData, int value, TransMeta aTransMeta, Trans aTrans ); boolean processRow( StepMetaInterface metaInterface, StepDataInterface dataInterface ); boolean init( StepMetaInterface smi, StepDataInterface sdi ); void dispose( StepMetaInterface smi, StepDataInterface sdi ); static final String NS_PREFIX; }### Answer:
@Test public void getLocationFrom() { HttpPost postMethod = mock( HttpPost.class ); Header locationHeader = new BasicHeader( LOCATION_HEADER, TEST_URL ); doReturn( locationHeader ).when( postMethod ).getFirstHeader( LOCATION_HEADER ); assertEquals( TEST_URL, WebService.getLocationFrom( postMethod ) ); }