@Test public void test_should_return_null_when_request_body_is_empty() { final HashMap<String, Object> requestBody = new HashMap<>(); final RequestBodyInspector requestBodyInspector = new RequestBodyInspector(requestBody); assertNull(requestBodyInspector.getRequestInfo()); }
@SuppressWarnings("unchecked") public HashMap<String, Object> getRequestInfo() { if (isRequestInfoPresent()) { return (HashMap<String, Object>) requestBody.get(getRequestInfoFieldNamePresent()); } return null; }
RequestBodyInspector { @SuppressWarnings("unchecked") public HashMap<String, Object> getRequestInfo() { if (isRequestInfoPresent()) { return (HashMap<String, Object>) requestBody.get(getRequestInfoFieldNamePresent()); } return null; } }
RequestBodyInspector { @SuppressWarnings("unchecked") public HashMap<String, Object> getRequestInfo() { if (isRequestInfoPresent()) { return (HashMap<String, Object>) requestBody.get(getRequestInfoFieldNamePresent()); } return null; } RequestBodyInspector(HashMap<String, Object> requestBody); }
RequestBodyInspector { @SuppressWarnings("unchecked") public HashMap<String, Object> getRequestInfo() { if (isRequestInfoPresent()) { return (HashMap<String, Object>) requestBody.get(getRequestInfoFieldNamePresent()); } return null; } RequestBodyInspector(HashMap<String, Object> requestBody); boolean isRequestInfoPresent(); HashMap<String, Object> getRequestBody(); void updateRequestInfo(HashMap<String, Object> requestInfo); @SuppressWarnings("unchecked") HashMap<String, Object> getRequestInfo(); }
RequestBodyInspector { @SuppressWarnings("unchecked") public HashMap<String, Object> getRequestInfo() { if (isRequestInfoPresent()) { return (HashMap<String, Object>) requestBody.get(getRequestInfoFieldNamePresent()); } return null; } RequestBodyInspector(HashMap<String, Object> requestBody); boolean isRequestInfoPresent(); HashMap<String, Object> getRequestBody(); void updateRequestInfo(HashMap<String, Object> requestInfo); @SuppressWarnings("unchecked") HashMap<String, Object> getRequestInfo();  }