Package org.jtalks.jcommune.web.dto

Examples of org.jtalks.jcommune.web.dto.UserProfileDto


    validator = new ChangedEmailValidator(userService, userDao);
  }

  @Test
  public void emptyEmailShouldBeValidBecauseItIsNotBusy() {
    UserProfileDto editedUserProfile = new UserProfileDto();
    editedUserProfile.setEmail(null);
        boolean isValid = validator.isValid(editedUserProfile, validatorContext);

        assertTrue(isValid, "Empty email should be valid, becuase it isn't busy.");
  }
View Full Code Here


        assertTrue(isValid, "Empty email should be valid, becuase it isn't busy.");
  }

  @Test
  public void notChangedEmailShouldBeValid() {
        UserProfileDto editedUserProfile = new UserProfileDto();
        editedUserProfile.setEmail(userEmail);

    boolean isValid = validator.isValid(editedUserProfile, validatorContext);

    assertTrue(isValid, "Email of current user isn't valid.");
  }
View Full Code Here

    assertTrue(isValid, "Email of current user isn't valid.");
  }

  @Test
  public void changedEmailShouldBeValidIfItIsNotBusy() {
        UserProfileDto editedUserProfile = new UserProfileDto();
        editedUserProfile.setEmail("new_current_user@gmail.com");

      boolean isValid = validator.isValid(editedUserProfile, validatorContext);

      assertTrue(isValid, "New email isn't taken, so it must be valid.");
  }
View Full Code Here

  @Test
    public void changedEmailShouldNotBeValidIfItIsBusy() {
        when(userDao.getByEmail(anyString())).thenReturn(
                new JCUser("new_current_user@gmail.com", "email", "password"));
        UserProfileDto editedUserProfile = new UserProfileDto();
        editedUserProfile.setEmail("new_current_user@gmail.com");
        when(validatorContext.buildConstraintViolationWithTemplate(null)).
                thenReturn(violationBuilder);
        when(violationBuilder.addNode(anyString())).
                thenReturn(nodeBuilderDefinedContext);
View Full Code Here

TOP

Related Classes of org.jtalks.jcommune.web.dto.UserProfileDto

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.