class AuthenticationRequestWrapper extends HttpServletRequestWrapper {

    @Override
    public ServletInputStream getInputStream() throws IOException {
        ByteArrayInputStream inputStream = new ByteArrayInputStream(body.getBytes());

        return new ServletInputStream() {

            @Override
            public boolean isFinished() {
                return inputStream.available() == 0;
            }

            @Override
            public boolean isReady() {
                return true;
            }

            @Override
            public void setReadListener(ReadListener listener) {
                throw new IllegalStateException("Not implemented");
            }

            @Override
            public int read() throws IOException {
                return inputStream.read();
            }
        };
    }

      AuthenticationRequestWrapper(HttpServletRequest request);

}