final String protocolVersionHeader,
final String responseStr,
final TestResponseProcessors.TestConnectionStateMessage.State expectedRegisterState)
throws JsonGenerationException, JsonMappingException, IOException
{
HttpRequest msgReq;
HttpChunk body;
objCapture.clear();
conn.requestRegister("1", msg); // calls createRegisterUrl(), which appends protocolVersion=4
// verify server gets the /register request
msgReq = captureRequest(objCapture);
Assert.assertTrue(msgReq.getUri().startsWith("/register"));
Assert.assertTrue(msgReq.getUri().indexOf(DatabusHttpHeaders.PROTOCOL_VERSION_PARAM + "=4") >= 0);
sourcesResp.setHeader(DatabusHttpHeaders.DBUS_CLIENT_RELAY_PROTOCOL_VERSION_HDR, protocolVersionHeader);
body = new DefaultHttpChunk(ChannelBuffers.wrappedBuffer(responseStr.getBytes(Charset.defaultCharset())));
NettyTestUtils.sendServerResponses(_dummyServer, clientAddr, sourcesResp, body);