Search in sources :

Example 11 with CreateAccountRequestDTO

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));
}
Also used : Violation(com.nexblocks.authguard.api.dto.validation.violations.Violation) CreateAccountRequestDTO(com.nexblocks.authguard.api.dto.requests.CreateAccountRequestDTO) Test(org.junit.jupiter.api.Test)

Aggregations

CreateAccountRequestDTO (com.nexblocks.authguard.api.dto.requests.CreateAccountRequestDTO)11 Test (org.junit.jupiter.api.Test)11 Violation (com.nexblocks.authguard.api.dto.validation.violations.Violation)6 AccountBO (com.nexblocks.authguard.service.model.AccountBO)4 RequestContextBO (com.nexblocks.authguard.service.model.RequestContextBO)4 ValidatableResponse (io.restassured.response.ValidatableResponse)4 CreateCompleteAccountRequestDTO (com.nexblocks.authguard.api.dto.requests.CreateCompleteAccountRequestDTO)3 CreateCompleteAccountResponseDTO (com.nexblocks.authguard.api.dto.requests.CreateCompleteAccountResponseDTO)3 CreateCredentialsRequestDTO (com.nexblocks.authguard.api.dto.requests.CreateCredentialsRequestDTO)3 CredentialsBO (com.nexblocks.authguard.service.model.CredentialsBO)3 IdempotencyException (com.nexblocks.authguard.service.exceptions.IdempotencyException)2 CompletionException (java.util.concurrent.CompletionException)2 AccountDTO (com.nexblocks.authguard.api.dto.entities.AccountDTO)1