use of com.nexblocks.authguard.api.dto.requests.AccountEmailsRequestDTO in project AuthGuard by AuthGuard.
the class AccountEmailsRequestValidatorTest method validateInvalidEmail.
@Test
void validateInvalidEmail() {
final AccountEmailsRequestDTO request = AccountEmailsRequestDTO.builder().email(AccountEmailDTO.builder().email("invalid").build()).build();
final Validator<AccountEmailsRequestDTO> validator = Validators.getForClass(AccountEmailsRequestDTO.class);
final List<Violation> violations = validator.validate(request);
assertThat(violations).containsExactly(new Violation("email", ViolationType.INVALID_VALUE));
}
use of com.nexblocks.authguard.api.dto.requests.AccountEmailsRequestDTO in project AuthGuard by AuthGuard.
the class AccountEmailsRequestValidatorTest method validateValid.
@Test
void validateValid() {
final AccountEmailsRequestDTO request = AccountEmailsRequestDTO.builder().email(AccountEmailDTO.builder().email("valid@valid.com").build()).build();
final Validator<AccountEmailsRequestDTO> validator = Validators.getForClass(AccountEmailsRequestDTO.class);
final List<Violation> violations = validator.validate(request);
assertThat(violations).isEmpty();
}
Aggregations