@Test public void testTransformShouldSetResponseHeader() { setMocksForMessageContent(); setMocksForMessageConfiguration(); underTest.transformResponse(browserMobHttpResponse); verify(response).addHeader("respName", "respValue"); }
public WilmaHttpResponse transformResponse(final BrowserMobHttpResponse response) { boolean isResponseVolatile = response.isResponseVolatile(); WilmaHttpResponse result = responseFactory.createNewWilmaHttpResponse(isResponseVolatile); if (response.getRawResponse() != null) { for (Header header : response.getRawResponse().getAllHeaders()) { result.addHeader(header.getName(), header.getValue()); } } for (Header header : response.getRequestHeaders()) { result.addRequestHeader(header.getName(), header.getValue()); } result.setRequestLine(response.getMethod().getRequestLine().toString()); result.setProxyRequestLine(response.getProxyRequestURI().toString()); String body = response.getBody(); int status = response.getStatus(); result.setBody(body); result.setContentType(response.getContentType()); result.setStatusCode(status); String instancePrefix = prepareInstancePrefix(); result.setWilmaMessageId(instancePrefix + response.getEntry().getWilmaEntryId()); String ipAddress = response.getEntry().getServerIPAddress(); result.setRemoteAddr(ipAddress); return result; }
HttpResponseTransformer { public WilmaHttpResponse transformResponse(final BrowserMobHttpResponse response) { boolean isResponseVolatile = response.isResponseVolatile(); WilmaHttpResponse result = responseFactory.createNewWilmaHttpResponse(isResponseVolatile); if (response.getRawResponse() != null) { for (Header header : response.getRawResponse().getAllHeaders()) { result.addHeader(header.getName(), header.getValue()); } } for (Header header : response.getRequestHeaders()) { result.addRequestHeader(header.getName(), header.getValue()); } result.setRequestLine(response.getMethod().getRequestLine().toString()); result.setProxyRequestLine(response.getProxyRequestURI().toString()); String body = response.getBody(); int status = response.getStatus(); result.setBody(body); result.setContentType(response.getContentType()); result.setStatusCode(status); String instancePrefix = prepareInstancePrefix(); result.setWilmaMessageId(instancePrefix + response.getEntry().getWilmaEntryId()); String ipAddress = response.getEntry().getServerIPAddress(); result.setRemoteAddr(ipAddress); return result; } }
HttpResponseTransformer { public WilmaHttpResponse transformResponse(final BrowserMobHttpResponse response) { boolean isResponseVolatile = response.isResponseVolatile(); WilmaHttpResponse result = responseFactory.createNewWilmaHttpResponse(isResponseVolatile); if (response.getRawResponse() != null) { for (Header header : response.getRawResponse().getAllHeaders()) { result.addHeader(header.getName(), header.getValue()); } } for (Header header : response.getRequestHeaders()) { result.addRequestHeader(header.getName(), header.getValue()); } result.setRequestLine(response.getMethod().getRequestLine().toString()); result.setProxyRequestLine(response.getProxyRequestURI().toString()); String body = response.getBody(); int status = response.getStatus(); result.setBody(body); result.setContentType(response.getContentType()); result.setStatusCode(status); String instancePrefix = prepareInstancePrefix(); result.setWilmaMessageId(instancePrefix + response.getEntry().getWilmaEntryId()); String ipAddress = response.getEntry().getServerIPAddress(); result.setRemoteAddr(ipAddress); return result; }  }
HttpResponseTransformer { public WilmaHttpResponse transformResponse(final BrowserMobHttpResponse response) { boolean isResponseVolatile = response.isResponseVolatile(); WilmaHttpResponse result = responseFactory.createNewWilmaHttpResponse(isResponseVolatile); if (response.getRawResponse() != null) { for (Header header : response.getRawResponse().getAllHeaders()) { result.addHeader(header.getName(), header.getValue()); } } for (Header header : response.getRequestHeaders()) { result.addRequestHeader(header.getName(), header.getValue()); } result.setRequestLine(response.getMethod().getRequestLine().toString()); result.setProxyRequestLine(response.getProxyRequestURI().toString()); String body = response.getBody(); int status = response.getStatus(); result.setBody(body); result.setContentType(response.getContentType()); result.setStatusCode(status); String instancePrefix = prepareInstancePrefix(); result.setWilmaMessageId(instancePrefix + response.getEntry().getWilmaEntryId()); String ipAddress = response.getEntry().getServerIPAddress(); result.setRemoteAddr(ipAddress); return result; }  WilmaHttpResponse transformResponse(final BrowserMobHttpResponse response); }
HttpResponseTransformer { public WilmaHttpResponse transformResponse(final BrowserMobHttpResponse response) { boolean isResponseVolatile = response.isResponseVolatile(); WilmaHttpResponse result = responseFactory.createNewWilmaHttpResponse(isResponseVolatile); if (response.getRawResponse() != null) { for (Header header : response.getRawResponse().getAllHeaders()) { result.addHeader(header.getName(), header.getValue()); } } for (Header header : response.getRequestHeaders()) { result.addRequestHeader(header.getName(), header.getValue()); } result.setRequestLine(response.getMethod().getRequestLine().toString()); result.setProxyRequestLine(response.getProxyRequestURI().toString()); String body = response.getBody(); int status = response.getStatus(); result.setBody(body); result.setContentType(response.getContentType()); result.setStatusCode(status); String instancePrefix = prepareInstancePrefix(); result.setWilmaMessageId(instancePrefix + response.getEntry().getWilmaEntryId()); String ipAddress = response.getEntry().getServerIPAddress(); result.setRemoteAddr(ipAddress); return result; }  WilmaHttpResponse transformResponse(final BrowserMobHttpResponse response);  }