@Test public void failedTransformFromHttpEntityToStringEntityNull() { try { HTTPTransformer.transformHttpEntityToString(null); } catch (InternalErrorException e) { Assert.assertEquals(CustomerMessage.INPUT_NULL_OR_EMPTY_ERROR, e.getMessage()); } }
public static String transformHttpEntityToString(final HttpEntity entity) throws InternalErrorException { if (entity == null) { throw new InternalErrorException(CustomerMessage.INPUT_NULL_OR_EMPTY_ERROR); } try { return EntityUtils.toString(entity); } catch (IOException e) { throw new InternalErrorException(CustomerMessage.INTERNAL_ERROR, e); } }
HTTPTransformer { public static String transformHttpEntityToString(final HttpEntity entity) throws InternalErrorException { if (entity == null) { throw new InternalErrorException(CustomerMessage.INPUT_NULL_OR_EMPTY_ERROR); } try { return EntityUtils.toString(entity); } catch (IOException e) { throw new InternalErrorException(CustomerMessage.INTERNAL_ERROR, e); } } }
HTTPTransformer { public static String transformHttpEntityToString(final HttpEntity entity) throws InternalErrorException { if (entity == null) { throw new InternalErrorException(CustomerMessage.INPUT_NULL_OR_EMPTY_ERROR); } try { return EntityUtils.toString(entity); } catch (IOException e) { throw new InternalErrorException(CustomerMessage.INTERNAL_ERROR, e); } }  }
HTTPTransformer { public static String transformHttpEntityToString(final HttpEntity entity) throws InternalErrorException { if (entity == null) { throw new InternalErrorException(CustomerMessage.INPUT_NULL_OR_EMPTY_ERROR); } try { return EntityUtils.toString(entity); } catch (IOException e) { throw new InternalErrorException(CustomerMessage.INTERNAL_ERROR, e); } }  static Request apiGatewayRequestToESRequest(@NonNull final APIGatewayProxyRequestEvent requestEvent); static APIGatewayProxyResponseEvent esResponseToAPIGatewayResponse(@NonNull final Response esResponse); static String transformHttpEntityToString(final HttpEntity entity); }
HTTPTransformer { public static String transformHttpEntityToString(final HttpEntity entity) throws InternalErrorException { if (entity == null) { throw new InternalErrorException(CustomerMessage.INPUT_NULL_OR_EMPTY_ERROR); } try { return EntityUtils.toString(entity); } catch (IOException e) { throw new InternalErrorException(CustomerMessage.INTERNAL_ERROR, e); } }  static Request apiGatewayRequestToESRequest(@NonNull final APIGatewayProxyRequestEvent requestEvent); static APIGatewayProxyResponseEvent esResponseToAPIGatewayResponse(@NonNull final Response esResponse); static String transformHttpEntityToString(final HttpEntity entity);  }