### Question:
HTTPTransformer { public static APIGatewayProxyResponseEvent esResponseToAPIGatewayResponse(@NonNull final Response esResponse) throws InternalErrorException { int statusCode = esResponse.getStatusLine().getStatusCode(); HttpEntity entity = esResponse.getEntity(); if (entity == null) { return new APIGatewayProxyResponseEvent().withStatusCode(statusCode); } String responseBody = transformHttpEntityToString(entity); return new APIGatewayProxyResponseEvent() .withStatusCode(statusCode) .withBody(responseBody); }  static Request apiGatewayRequestToESRequest(@NonNull final APIGatewayProxyRequestEvent requestEvent); static APIGatewayProxyResponseEvent esResponseToAPIGatewayResponse(@NonNull final Response esResponse); static String transformHttpEntityToString(final HttpEntity entity);  }### Answer:
@Test public void correctRequestTransformFromESToGWWithEmptyBody() { StatusLine mockStatusLine = mock(StatusLine.class); when(mockESResponse.getStatusLine()).thenReturn(mockStatusLine); when(mockStatusLine.getStatusCode()).thenReturn(TestConstants.STATUS_CODE_OK); when(mockESResponse.getEntity()).thenReturn(null); APIGatewayProxyResponseEvent apiGWResponse = HTTPTransformer.esResponseToAPIGatewayResponse(mockESResponse); assertEquals(TestConstants.STATUS_CODE_OK, apiGWResponse.getStatusCode().intValue()); assertNull(apiGWResponse.getBody()); }
@Test public void correctRequestTransformFromESToGW() throws IOException { StatusLine mockStatusLine = mock(StatusLine.class); when(mockESResponse.getStatusLine()).thenReturn(mockStatusLine); when(mockStatusLine.getStatusCode()).thenReturn(TestConstants.STATUS_CODE_OK); when(mockESResponse.getEntity()).thenReturn(new NStringEntity(TestConstants.DUMMY_MESSAGE)); APIGatewayProxyResponseEvent apiGWResponse = HTTPTransformer.esResponseToAPIGatewayResponse(mockESResponse); assertEquals(TestConstants.STATUS_CODE_OK, apiGWResponse.getStatusCode().intValue()); assertEquals(TestConstants.DUMMY_MESSAGE, apiGWResponse.getBody()); }