### Question:
MinijaxServlet extends HttpServlet { @Override public void init() throws ServletException { throw new ServletException("Missing init parameter \"javax.ws.rs.Application\""); }  @Override void init(); @Override @SuppressWarnings("rawtypes") void init(final ServletConfig config);  }### Answer:
@Test(expected = ServletException.class) public void testInit() throws ServletException { final MinijaxServlet servlet = new MinijaxServlet(); servlet.init(); }
@Test(expected = ServletException.class) public void testInitNullParam() throws ServletException { final MinijaxServlet servlet = new MinijaxServlet(); servlet.init(new TestConfig(null)); }
@Test(expected = ServletException.class) public void testInitEmptyParam() throws ServletException { final MinijaxServlet servlet = new MinijaxServlet(); servlet.init(new TestConfig("")); }
@Test(expected = ServletException.class) public void testInitNotFoundParam() throws ServletException { final MinijaxServlet servlet = new MinijaxServlet(); servlet.init(new TestConfig("com.doesnotexist.Foo")); }
@Test public void testInitParamSuccess() throws ServletException { final MinijaxServlet servlet = new MinijaxServlet(); servlet.init(new TestConfig("org.minijax.servlet.MinijaxServletTest$TestApp")); }