### Question:
SourceConfiguration extends BaseConfiguration { public void build() throws AxisFault { super.build(); port = ParamUtils.getRequiredParamInt(parameters, "port"); Parameter hostParameter = inDescription.getParameter(TransportListener.HOST_ADDRESS); if (hostParameter != null) { host = ((String) hostParameter.getValue()).trim(); } else { try { host = java.net.InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException e) { log.warn("Unable to lookup local host name, using 'localhost'"); } } Parameter param = inDescription.getParameter(PassThroughConstants.WSDL_EPR_PREFIX); if (param != null) { serviceEPRPrefix = getServiceEPRPrefix(configurationContext, (String) param.getValue()); customEPRPrefix = (String) param.getValue(); } else { serviceEPRPrefix = getServiceEPRPrefix(configurationContext, host, port); customEPRPrefix = scheme.getName() + ": (port == scheme.getDefaultPort() ? "" : port) + "/"; } param = inDescription.getParameter(NhttpConstants.HTTP_GET_PROCESSOR); if (param != null && param.getValue() != null) { httpGetRequestProcessor = createHttpGetProcessor(param.getValue().toString()); if (httpGetRequestProcessor == null) { handleException("Cannot create HttpGetRequestProcessor"); } } populatePreserveHttpHeaders(conf.getResponsePreseveHttpHeaders()); } SourceConfiguration(ConfigurationContext configurationContext,
                               TransportInDescription description,
                               Scheme scheme,
                               WorkerPool pool,
                               PassThroughTransportMetricsCollector metrics);  SourceConfiguration(WorkerPool pool,PassThroughTransportMetricsCollector metrics); void build(); HttpParams getHttpParams(); IOReactorConfig getIOReactorConfig(); HttpProcessor getHttpProcessor(); HttpResponseFactory getResponseFactory(); String getHostname(); int getPort(); SourceConnections getSourceConnections(); TransportInDescription getInDescription(); Scheme getScheme(); String getServiceEPRPrefix(); String getCustomEPRPrefix(); HttpGetRequestProcessor getHttpGetRequestProcessor(); boolean getBooleanValue(String name, boolean def);  }### Answer:
@Test public void testBuild() throws Exception { Assert.assertNotNull("Building base configuration isn't successful.", sourceConfiguration); Assert.assertNotNull("Worker pool hasn't been initialized.", sourceConfiguration.getWorkerPool()); Assert.assertNotSame("Worker thread count hasn't been taken from passthru-http.properties file", passThroughConfiguration.getWorkerPoolCoreSize(), DEFAULT_WORKER_POOL_SIZE_CORE); }
@Test public void testFaultGetHttpGetRequestProcessor() { Parameter httpGetProcessor = new Parameter("httpGetProcessor", INCORRECT_HTTP_GET_PROCESSOR); try { httpGetProcessor.setParameterElement(AXIOMUtil.stringToOM( "<parameter name=\"httpGetProcessor\" locked=\"false\">" + INCORRECT_HTTP_GET_PROCESSOR + "</parameter>")); transportInDescription.addParameter(httpGetProcessor); sourceConfiguration.build(); } catch (Exception ex) { Assert.assertNotNull("Error message is null", ex.getMessage()); Assert.assertTrue("", ex.getMessage().contains("Error creating WSDL processor")); } }
@Test public void testInvalidGetHttpGetRequestProcessor() { Parameter httpGetProcessor = new Parameter("httpGetProcessor", INVALID_HTTP_GET_PROCESSOR); try { httpGetProcessor.setParameterElement(AXIOMUtil.stringToOM( "<parameter name=\"httpGetProcessor\" locked=\"false\">" + INVALID_HTTP_GET_PROCESSOR + "</parameter>")); transportInDescription.addParameter(httpGetProcessor); sourceConfiguration.build(); } catch (Exception ex) { Assert.assertNotNull("Error message is null", ex.getMessage()); Assert.assertTrue("", ex.getMessage().contains("Error creating WSDL processor")); } }