Package es.udc.tfg.journals.model.userservice

Examples of es.udc.tfg.journals.model.userservice.UserDetails


  @Test(expected = InstanceNotFoundException.class)
  public void testDeleteAccount() throws DuplicateInstanceException,
      InstanceNotFoundException, IncorrectPasswordException {
    /* Register and delete user. */
    User user = userService.registerUser("userPassword", new UserDetails(
        "name", "lastName", "user@udc.es", "user"));

    userService.deleteAccount(user.getUserId(), "userPassword");

    /* Check that doesn't exists. */
 
View Full Code Here


    userService.findUser(user.getUserId());
  }

  private User registerUser(String email, String clearPassword) {

    UserDetails userDetails = new UserDetails("name", "lastName",
        "user@udc.es", "user");

    try {
      return userService.registerUser(clearPassword, userDetails);
View Full Code Here

    UserService userService = ctx.getBean(UserService.class);

    try {
      // Register user.
      User userProfile = userService.registerUser("userPassword",
          new UserDetails("name", "lastName", "user@udc.es", "user"));
      System.out.println("User with userId '" + userProfile.getUserId()
          + "' has been created");
      System.out.println(userProfile);

      // Find user.
View Full Code Here

  private User user2;
  private User user3;

  @Before
  public void setUp() throws Exception {
    user1 = userService.registerUser("userPassword", new UserDetails(
        "name1", "lastName", "user1@udc.es", "user1"));
    user2 = userService.registerUser("userPassword", new UserDetails(
        "name2", "lastName", "user2@udc.es", "user2"));
    user3 = userService.registerUser("userPassword", new UserDetails(
        "name3", "lastName", "user3@udc.es", "user3"));
    userService.registerUser("userPassword", new UserDetails("name4",
        "lastName", "user4@udc.es", "user4"));

    // Query
    journal1 = journalService.createJournal(new Journal(
        "siam journal on applied mathematics", "j1", "", 0, 0));
View Full Code Here

    if (!password.equals(retypePassword)) {
      registrationForm.recordError(passwordField,
          messages.get("error-passwordsDoesntMatch"));
    } else {
      try {
        user = userService.registerUser(password, new UserDetails(
            firstName, lastName, email, login));
      } catch (DuplicateInstanceException e) {
        if (e.getKey().toString().contains("@")) {
          registrationForm.recordError(emailField,
              messages.get("error-emailAlreadyExists"));
View Full Code Here

      return null;
    }

    try {
      userService.updateUserDetails(userSession.getUserId(),
          new UserDetails(firstName, lastName, email, login));
    } catch (DuplicateInstanceException e) {
      updateForm.recordError(messages
          .get("error-emailOrLoginAlreadyExists"));
    } catch (InstanceNotFoundException e) {
      notFound.setInstanceId(userSession.getUserId().toString());
View Full Code Here

            }
          }
        } catch (InstanceNotFoundException e1) {
        }
        try {
          user = userService.registerUser(null, new UserDetails(
              firstName, lastName, email, login));
          createUserSession();
        } catch (DuplicateInstanceException e1) {
          error = true;
        }
View Full Code Here

            }
          }
        } catch (InstanceNotFoundException e1) {
        }
        try {
          user = userService.registerUser(null, new UserDetails(
              firstName, lastName, email, login));
          createUserSession();
        } catch (DuplicateInstanceException e1) {
          error = true;
        }
View Full Code Here

TOP

Related Classes of es.udc.tfg.journals.model.userservice.UserDetails

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.