Ejemplo n.º 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!");
 }
Ejemplo n.º 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"));
 }
Ejemplo n.º 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());
  }