@Test public void testLoginNotUser() throws Exception { send( "/employee/login", QueryFilter.valueOf("username", "admin"), QueryFilter.valueOf("password", "123456")); Assert.assertEquals("redirect:/system/init.do", view.getViewName()); shopLogger.info("test login() success!"); }
@Test public void testsetLeftMenu() { send( "/employee/login", QueryFilter.valueOf("username", "admin"), QueryFilter.valueOf("password", "123456")); send( "/setLeftMenu", QueryFilter.valueOf("username", "admin"), QueryFilter.valueOf("password", "123456")); }
@Test public void testLoginSucc() { send("/system/init"); send( "/employee/login", QueryFilter.valueOf("username", "admin"), QueryFilter.valueOf("password", "123456")); Assert.assertEquals("redirect:/control/center/main.do", view.getViewName()); UserModel user = (UserModel) request.getSession().getAttribute(UserModel.LOGIN_USER_KEY); Assert.assertNotNull(user); Assert.assertEquals("admin", user.getUsername()); }