Search in sources :

Example 6 with PasswordResetRequestDTO

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

the class PasswordResetRequestValidatorTest method validateValidByPasswordWithoutDomain.

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

Aggregations

PasswordResetRequestDTO (com.nexblocks.authguard.api.dto.requests.PasswordResetRequestDTO)6 Violation (com.nexblocks.authguard.api.dto.validation.violations.Violation)5 Test (org.junit.jupiter.api.Test)5