Search in sources :

Example 11 with AuthRequestDTO

use of com.nexblocks.authguard.api.dto.requests.AuthRequestDTO in project AuthGuard by AuthGuard.

the class AuthRequestValidatorTest method validateWithIdentifierButNoDomain.

@Test
void validateWithIdentifierButNoDomain() {
    final AuthRequestDTO valid = AuthRequestDTO.builder().identifier("identifier").build();
    final Validator<AuthRequestDTO> validator = Validators.getForClass(AuthRequestDTO.class);
    final List<Violation> violations = validator.validate(valid);
    assertThat(violations).containsExactly(new Violation("domain", ViolationType.MISSING_REQUIRED_VALUE));
}
Also used : Violation(com.nexblocks.authguard.api.dto.validation.violations.Violation) AuthRequestDTO(com.nexblocks.authguard.api.dto.requests.AuthRequestDTO) Test(org.junit.jupiter.api.Test)

Aggregations

AuthRequestDTO (com.nexblocks.authguard.api.dto.requests.AuthRequestDTO)11 Test (org.junit.jupiter.api.Test)6 Error (com.nexblocks.authguard.api.dto.entities.Error)4 Violation (com.nexblocks.authguard.api.dto.validation.violations.Violation)4 RequestContextBO (com.nexblocks.authguard.service.model.RequestContextBO)4 AuthResponseBO (com.nexblocks.authguard.service.model.AuthResponseBO)3 AuthResponseDTO (com.nexblocks.authguard.api.dto.entities.AuthResponseDTO)2 AuthRequestBO (com.nexblocks.authguard.service.model.AuthRequestBO)2 AppBO (com.nexblocks.authguard.service.model.AppBO)1 ValidatableResponse (io.restassured.response.ValidatableResponse)1