### Question:
ProfitBricksSoapMessageEnvelope implements HttpRequestFilter { @Override public HttpRequest filter(HttpRequest request) throws HttpException { checkNotNull(request.getPayload(), "HTTP Request must contain payload message."); return createSoapRequest(request); }  @Override HttpRequest filter(HttpRequest request);  }### Answer:
@Test public void testPayloadEnclosedWithSoapTags() { String requestBody = "<ws:getAllDataCenters/>"; String expectedPayload = SOAP_PREFIX.concat(requestBody).concat(SOAP_SUFFIX); HttpRequest request = HttpRequest.builder().method("POST").endpoint(ENDPOINT).payload(requestBody).build(); ProfitBricksSoapMessageEnvelope soapEnvelope = new ProfitBricksSoapMessageEnvelope(); HttpRequest filtered = soapEnvelope.filter(request); assertEquals(filtered.getPayload().getRawContent(), expectedPayload); assertEquals(filtered.getPayload().getContentMetadata().getContentLength(), Long.valueOf(expectedPayload.getBytes().length)); }
@Test(expectedExceptions = NullPointerException.class, expectedExceptionsMessageRegExp = ".*must contain payload message.*") public void testNullRequest() { HttpRequest request = HttpRequest.builder().method("POST").endpoint(ENDPOINT).build(); new ProfitBricksSoapMessageEnvelope().filter(request); }