- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {Charset c =
String charsetName;Charset.forName(charsetName)
Charset.defaultCharset()
ContentType contentType;contentType.getCharset()
- Smart code suggestions by Codota
}
private Servlet instantiateServlet(final Class<? extends HttpServlet> serverClass) throws ServletInitializationException { try { return serverClass.newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new ServletInitializationException(e); } }
@Test(expected = UnexpectedSituationException.class) public void shouldWrapServletInitializationException() throws IOException, ServletException, ServletInitializationException { when(servletContainer.getServletForClass(any(Class.class), any(ServletConfig.class))) .thenThrow(new ServletInitializationException(new Exception())); servletResourceProvider.load("/", request, response); } }