### Question:
GridForceRestartDelegateServlet extends RegistryBasedServlet { @Override protected void doPost(HttpServletRequest req, HttpServletResponse response) throws ServletException, IOException { process(req, response); } GridForceRestartDelegateServlet();  GridForceRestartDelegateServlet(GridRegistry registry);  static final String RESOURCE_PAGE_FILE; static final String FORM_ID; static final String SUBMIT; static final String NODES; }### Answer:
@Test public void testPostForRedirectToLoginServlet() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); MockHttpServletResponse response = new MockHttpServletResponse(); servlet.doPost(request, response); validateRedirectedToLoginServlet(response); }
@Test public void testPostGracefulRestart() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); request.getSession(true); request.addParameter(GridForceRestartDelegateServlet.FORM_ID, "restart_nodes"); request.addParameter(GridForceRestartDelegateServlet.NODES, ipAddress); request.addParameter(GridForceRestartDelegateServlet.SUBMIT, "restart"); MockHttpServletResponse response = new MockHttpServletResponse(); servlet.doPost(request, response); validateHtmlResponseContent(response, "Restart process initiated on all nodes."); }
@Test public void testPostDefaultHtmlResponse() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); request.getSession(true); MockHttpServletResponse response = new MockHttpServletResponse(); servlet.doPost(request, response); validateDefaultHtmlResponse(response); }