### Question:
HTTPConduit extends AbstractConduit implements Configurable, Assertor, PropertyChangeListener { protected abstract OutputStream createOutputStream(Message message, boolean needToCacheRequest, boolean isChunking, int chunkThreshold) throws IOException; HTTPConduit(Bus b, EndpointInfo ei);  HTTPConduit(Bus b,
                       EndpointInfo ei,
                       EndpointReferenceType t); final String getConduitName(); void finalizeConfig(); Map<String, Cookie> getCookies(); void prepare(Message message); void close(Message msg); void close(); String getAddress(); String getBeanName(); AuthorizationPolicy getEffectiveAuthPolicy(Message message); AuthorizationPolicy getAuthorization(); void setAuthorization(AuthorizationPolicy authorization); HTTPClientPolicy getClient(Message message); HTTPClientPolicy getClient(); void setClient(HTTPClientPolicy client); ProxyAuthorizationPolicy getProxyAuthorization(); void setProxyAuthorization(
            ProxyAuthorizationPolicy proxyAuthorization
    ); TLSClientParameters getTlsClientParameters(); void setTlsClientParameters(TLSClientParameters params); MessageTrustDecider getTrustDecider(); void setTrustDecider(MessageTrustDecider decider); HttpAuthSupplier getAuthSupplier(); void setAuthSupplier(HttpAuthSupplier supplier); HttpAuthSupplier getProxyAuthSupplier(); void setProxyAuthSupplier(HttpAuthSupplier proxyAuthSupplier); void assertMessage(Message message); boolean canAssert(QName type); void propertyChange(PropertyChangeEvent evt); static final String KEY_HTTP_CONNECTION; static final String KEY_HTTP_CONNECTION_ADDRESS; static final String SET_HTTP_RESPONSE_MESSAGE; static final String HTTP_RESPONSE_MESSAGE; static final String PROCESS_FAULT_ON_HTTP_400; static final String NO_IO_EXCEPTIONS; }### Answer:
@Test public void testHandleResponseOnWorkqueueAllowCurrentThread() throws Exception { Message m = getNewMessage(); Exchange exchange = new ExchangeImpl(); Bus bus = new ExtensionManagerBus(); exchange.put(Bus.class, bus); EndpointInfo endpointInfo = new EndpointInfo(); Endpoint endpoint = new EndpointImpl(null, null, endpointInfo); exchange.put(Endpoint.class, endpoint); m.setExchange(exchange); HTTPClientPolicy policy = new HTTPClientPolicy(); policy.setAsyncExecuteTimeoutRejection(true); m.put(HTTPClientPolicy.class, policy); exchange.put(Executor.class, new Executor() { @Override public void execute(Runnable command) { throw new RejectedExecutionException("expected"); } }); HTTPConduit conduit = new MockHTTPConduit(bus, endpointInfo, policy); OutputStream os = conduit.createOutputStream(m, false, false, 0); assertTrue(os instanceof WrappedOutputStream); WrappedOutputStream wos = (WrappedOutputStream) os; try { wos.handleResponseOnWorkqueue(true, false); assertEquals(Thread.currentThread(), m.get(Thread.class)); try { wos.handleResponseOnWorkqueue(false, false); fail("Expected RejectedExecutionException not thrown"); } catch (RejectedExecutionException ex) { assertEquals("expected", ex.getMessage()); } } catch (Exception ex) { throw ex; } }