Package br.com.caelum.vraptor.mydvds.model

Examples of br.com.caelum.vraptor.mydvds.model.User


    controller = new UsersController(dao, userInfo, result, validator);
  }

  @Test
  public void listingAllUsersWillNotExposeTheirLoginAndPassword() throws Exception {
    User user = new User();
    user.setName("John");
    user.setLogin("john");
    user.setPassword("youwontknow");

    userListingWillContain(user);

    controller.list();
View Full Code Here


    assertThat(users.get(0).getName(), is("John"));
  }

  @Test
  public void addingAValidUserWillHappenWithoutErrors() throws Exception {
    User user = new User();
    user.setLogin("mylogin");
    user.setPassword("myPassword");
    user.setName("Testing");

    ifTheUserWithThisLoginDoesntExist("mylogin");
    willAddTheUser(user);

    controller.add(user);
View Full Code Here

    controller.add(user);
  }
  @Test(expected=ValidationException.class)
  public void addingAUserWithHibernateValidationErrors() throws Exception {
    User user = new User();
    user.setLogin("myLogin");
    user.setPassword("short");
    user.setName("Testing");

    ifTheUserWithThisLoginDoesntExist("myLogin");
    willNotAddTheUser(user);

    controller.add(user);
View Full Code Here

    controller.add(user);
  }
  @Test(expected=ValidationException.class)
  public void addingAUserWithInvalidLogin() throws Exception {
    User user = new User();
    user.setLogin("It's invalid");
    user.setPassword("short");
    user.setName("Testing");

    ifTheUserWithThisLoginDoesntExist("It's invalid");
    willNotAddTheUser(user);

    controller.add(user);
View Full Code Here

    controller.add(user);
  }
  @Test(expected=ValidationException.class)
  public void addingAUserWithAnUnavailableLogin() throws Exception {
    User user = new User();
    user.setLogin("myLogin");
    user.setPassword("myPassword");
    user.setName("Testing");

    ifTheUserWithThisLoginExists("myLogin");
    willNotAddTheUser(user);

    controller.add(user);
View Full Code Here

    controller = new HomeController(dao, userInfo, result, validator);
  }

  @Test
  public void logoutMustRemoveTheUserFromHttpSession() throws Exception {
    User user = new User();

    userInfo.login(user);
    assertThat(userInfo.getUser(), is(user));

    controller.logout();
View Full Code Here

    assertThat(userInfo.getUser(), is(nullValue()));
  }

  @Test
  public void loginWithAValidUserMustPutUserOnHttpSession() throws Exception {
    User user = new User();

    ifUserOnDaoIs(user);

    controller.login("valid", "user");
    assertThat(userInfo.getUser(), is(user));
View Full Code Here

TOP

Related Classes of br.com.caelum.vraptor.mydvds.model.User

Copyright © 2018 www.massapicom. 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.