コード例 #1
0
 /** Test of handleRequest method, of class IndexController. */
 @Test
 public void testHandleRequest() {
   System.out.println("handleRequest");
   RedirectAttributes redirect = null;
   HttpSession session = null;
   IndexController instance = new IndexController();
   String expResult = "redirect:" + redirect;
   String result = instance.handleRequest(redirect, session);
   assertEquals(expResult, result);
 }
コード例 #2
0
 /** Test of indexPage method, of class IndexController. */
 @Test
 public void testIndexPage() {
   System.out.println("indexPage");
   String errorMessage = "";
   Map<String, Object> model = new HashMap<String, Object>();
   IndexController instance = new IndexController();
   String expResult = "index";
   String result = instance.indexPage(errorMessage, model);
   assertEquals(expResult, result);
   assertTrue(!model.isEmpty());
   assertTrue(model.containsKey("errorMessage"));
   assertEquals(model.get("errorMessage"), "");
 }