Package me.kafeitu.demo.activiti.web.identify

Examples of me.kafeitu.demo.activiti.web.identify.UseController.logon()


  @Test
  public void testUserExistInDb() throws Exception {
    UseController c = new UseController();
    c.setIdentityService(identityService);
    MockHttpSession session = new MockHttpSession();
    String view = c.logon("kafeitu", "000000", session);
    assertEquals("redirect:/main/index", view);
    assertNotNull(session.getAttribute("user"));
    User user = (User) session.getAttribute("user");
    assertEquals("kafeitu", user.getId());
  }
View Full Code Here


  @Test
  public void testUserNotExistInDb() throws Exception {
    UseController c = new UseController();
    c.setIdentityService(identityService);
    MockHttpSession session = new MockHttpSession();
    String view = c.logon("nothisuser", "000000", session);
    assertEquals("redirect:/login?error=true", view);
  }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.