@Test(expected=VRaptorException.class) public void shouldThrowExceptionWhenAnUnsupportedEncodingExceptionOccurs() throws Exception { doThrow(new UnsupportedEncodingException()).when(request).setCharacterEncoding(anyString()); new WebXmlEncodingHandler("UTF-8").setEncoding(request, response); }
public void setEncoding(HttpServletRequest request, HttpServletResponse response) { try { request.setCharacterEncoding(encoding); response.setCharacterEncoding(encoding); } catch (UnsupportedEncodingException e) { throw new VRaptorException(e); } }
WebXmlEncodingHandler implements EncodingHandler { public void setEncoding(HttpServletRequest request, HttpServletResponse response) { try { request.setCharacterEncoding(encoding); response.setCharacterEncoding(encoding); } catch (UnsupportedEncodingException e) { throw new VRaptorException(e); } } }
WebXmlEncodingHandler implements EncodingHandler { public void setEncoding(HttpServletRequest request, HttpServletResponse response) { try { request.setCharacterEncoding(encoding); response.setCharacterEncoding(encoding); } catch (UnsupportedEncodingException e) { throw new VRaptorException(e); } } WebXmlEncodingHandler(String encoding); }
WebXmlEncodingHandler implements EncodingHandler { public void setEncoding(HttpServletRequest request, HttpServletResponse response) { try { request.setCharacterEncoding(encoding); response.setCharacterEncoding(encoding); } catch (UnsupportedEncodingException e) { throw new VRaptorException(e); } } WebXmlEncodingHandler(String encoding); void setEncoding(HttpServletRequest request, HttpServletResponse response); }
WebXmlEncodingHandler implements EncodingHandler { public void setEncoding(HttpServletRequest request, HttpServletResponse response) { try { request.setCharacterEncoding(encoding); response.setCharacterEncoding(encoding); } catch (UnsupportedEncodingException e) { throw new VRaptorException(e); } } WebXmlEncodingHandler(String encoding); void setEncoding(HttpServletRequest request, HttpServletResponse response);  }