### Question:
OgcXmlUtil { public static String getRequestBody(HttpServletRequest request) { ServletInputStream in = null; String body = null; try { in = request.getInputStream(); String encoding = request.getCharacterEncoding(); Charset charset; if (!StringUtils.isEmpty(encoding)) { charset = Charset.forName(encoding); } else { charset = Charset.forName(DEFAULT_CHARSET); } body = StreamUtils.copyToString(in, charset); } catch (IOException e) { LOG.error("Could not read the InputStream as String: " + e.getMessage()); } finally { IOUtils.closeQuietly(in); } return body; }  static String getRequestBody(HttpServletRequest request); static Document getDocumentFromString(String xml); static String getPathInDocument(Document document, String path); static NodeList getPathInDocumentAsNodeList(Document document, String path); static Element getDocumentElement(Document doc);  }### Answer:
@Test public void get_request_body_default_charset() { MockHttpServletRequest request = new MockHttpServletRequest(); request.setContent(XML_STRING.getBytes()); String body = OgcXmlUtil.getRequestBody(request); assertEquals(XML_STRING, body); }
@Test public void get_request_body_utf8() { MockHttpServletRequest request = new MockHttpServletRequest(); request.setContent(XML_STRING.getBytes()); request.setCharacterEncoding("UTF-8"); String body = OgcXmlUtil.getRequestBody(request); assertEquals(XML_STRING, body); }