@Test(expected = InvalidUserCreateException.class) public void test_should_throw_validation_exception_when_otp_reference_is_not_present_and_mandatory_flag_is_enabled() { User user = User.builder() .otpReference(null) .otpValidationMandatory(true) .build(); user.validateNewUser(); }
public void validateNewUser() { if (isUsernameAbsent() || isNameAbsent() || isMobileNumberAbsent() || isActiveIndicatorAbsent() || isTypeAbsent() || isPermanentAddressInvalid() || isCorrespondenceAddressInvalid() || isRolesAbsent() || isOtpReferenceAbsent() || isTenantIdAbsent()){ throw new InvalidUserCreateException(this); } }
User { public void validateNewUser() { if (isUsernameAbsent() || isNameAbsent() || isMobileNumberAbsent() || isActiveIndicatorAbsent() || isTypeAbsent() || isPermanentAddressInvalid() || isCorrespondenceAddressInvalid() || isRolesAbsent() || isOtpReferenceAbsent() || isTenantIdAbsent()){ throw new InvalidUserCreateException(this); } } }
User { public void validateNewUser() { if (isUsernameAbsent() || isNameAbsent() || isMobileNumberAbsent() || isActiveIndicatorAbsent() || isTypeAbsent() || isPermanentAddressInvalid() || isCorrespondenceAddressInvalid() || isRolesAbsent() || isOtpReferenceAbsent() || isTenantIdAbsent()){ throw new InvalidUserCreateException(this); } }  }
User { public void validateNewUser() { if (isUsernameAbsent() || isNameAbsent() || isMobileNumberAbsent() || isActiveIndicatorAbsent() || isTypeAbsent() || isPermanentAddressInvalid() || isCorrespondenceAddressInvalid() || isRolesAbsent() || isOtpReferenceAbsent() || isTenantIdAbsent()){ throw new InvalidUserCreateException(this); } }  User addAddressItem(Address addressItem); User addRolesItem(Role roleItem); void validateNewUser(); void validateUserModification(); boolean isCorrespondenceAddressInvalid(); boolean isPermanentAddressInvalid(); boolean isOtpReferenceAbsent(); boolean isTypeAbsent(); boolean isActiveIndicatorAbsent(); boolean isMobileNumberAbsent(); boolean isNameAbsent(); boolean isUsernameAbsent(); boolean isTenantIdAbsent(); boolean isPasswordAbsent(); boolean isRolesAbsent(); boolean isIdAbsent(); void nullifySensitiveFields(); boolean isLoggedInUserDifferentFromUpdatedUser(); void setRoleToCitizen(); void updatePassword(String newPassword); OtpValidationRequest getOtpValidationRequest(); List<Address> getPermanentAndCorrespondenceAddresses(); void setDefaultPasswordExpiry(int expiryInDays); void setActive(boolean isActive); }
User { public void validateNewUser() { if (isUsernameAbsent() || isNameAbsent() || isMobileNumberAbsent() || isActiveIndicatorAbsent() || isTypeAbsent() || isPermanentAddressInvalid() || isCorrespondenceAddressInvalid() || isRolesAbsent() || isOtpReferenceAbsent() || isTenantIdAbsent()){ throw new InvalidUserCreateException(this); } }  User addAddressItem(Address addressItem); User addRolesItem(Role roleItem); void validateNewUser(); void validateUserModification(); boolean isCorrespondenceAddressInvalid(); boolean isPermanentAddressInvalid(); boolean isOtpReferenceAbsent(); boolean isTypeAbsent(); boolean isActiveIndicatorAbsent(); boolean isMobileNumberAbsent(); boolean isNameAbsent(); boolean isUsernameAbsent(); boolean isTenantIdAbsent(); boolean isPasswordAbsent(); boolean isRolesAbsent(); boolean isIdAbsent(); void nullifySensitiveFields(); boolean isLoggedInUserDifferentFromUpdatedUser(); void setRoleToCitizen(); void updatePassword(String newPassword); OtpValidationRequest getOtpValidationRequest(); List<Address> getPermanentAndCorrespondenceAddresses(); void setDefaultPasswordExpiry(int expiryInDays); void setActive(boolean isActive);  }