### Question:
GridAutoUpgradeDelegateServlet extends RegistryBasedServlet { @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { process(req, resp); } GridAutoUpgradeDelegateServlet();  GridAutoUpgradeDelegateServlet(GridRegistry registry);  static final String RESOURCE_PAGE_FILE; static final String PENDING_NODE_FILE; static final String IDS; static final String PARAM_JSON; }### Answer:
@Test public void testPostForRedirectToLoginServlet() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); MockHttpServletResponse response = new MockHttpServletResponse(); servlet.doPost(request, response); validateRedirectedToLoginServlet(response); }
@Test public void testPostUpgradeHtmlResponse() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); request.getSession(true); request.addParameter(GridAutoUpgradeDelegateServlet.PARAM_JSON, "[]"); MockHttpServletResponse response = new MockHttpServletResponse(); servlet.doPost(request, response); validateHtmlResponseContent(response, "Auto upgrade 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); }