Пример #1
0
 @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!");
 }
Пример #2
0
 @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"));
 }
Пример #3
0
  @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());
  }