use of com.nexblocks.authguard.api.dto.requests.CreateAccountRequestDTO in project AuthGuard by AuthGuard.
the class CreateAccountRequestValidatorTest method validateInvalidBackupEmail.
@Test
void validateInvalidBackupEmail() {
final CreateAccountRequestDTO request = CreateAccountRequestDTO.builder().externalId("external").backupEmail(AccountEmailDTO.builder().email("invalid").build()).domain("main").build();
final Validator<CreateAccountRequestDTO> validator = Validators.getForClass(CreateAccountRequestDTO.class);
final List<Violation> violations = validator.validate(request);
assertThat(violations).contains(new Violation("backupEmail", ViolationType.INVALID_VALUE));
}
Aggregations