@Test void testValidateShouldReturnWithoutErrorWhenPublicKeyIdIsPresent() { EnvironmentDto environmentDto = createEnvironmentDto(null, "public-key-id"); ValidationResult actual = underTest.validate(environmentDto); Assertions.assertFalse(actual.hasError()); }
public ValidationResult validate(EnvironmentDto environmentDto) { ValidationResult.ValidationResultBuilder resultBuilder = ValidationResult.builder(); AuthenticationDto authentication = environmentDto.getAuthentication(); if (!StringUtils.hasText(authentication.getPublicKeyId())) { validate(authentication.getPublicKey(), resultBuilder); } return resultBuilder.build(); }
EnvironmentAuthenticationValidator { public ValidationResult validate(EnvironmentDto environmentDto) { ValidationResult.ValidationResultBuilder resultBuilder = ValidationResult.builder(); AuthenticationDto authentication = environmentDto.getAuthentication(); if (!StringUtils.hasText(authentication.getPublicKeyId())) { validate(authentication.getPublicKey(), resultBuilder); } return resultBuilder.build(); } }
EnvironmentAuthenticationValidator { public ValidationResult validate(EnvironmentDto environmentDto) { ValidationResult.ValidationResultBuilder resultBuilder = ValidationResult.builder(); AuthenticationDto authentication = environmentDto.getAuthentication(); if (!StringUtils.hasText(authentication.getPublicKeyId())) { validate(authentication.getPublicKey(), resultBuilder); } return resultBuilder.build(); }  }
EnvironmentAuthenticationValidator { public ValidationResult validate(EnvironmentDto environmentDto) { ValidationResult.ValidationResultBuilder resultBuilder = ValidationResult.builder(); AuthenticationDto authentication = environmentDto.getAuthentication(); if (!StringUtils.hasText(authentication.getPublicKeyId())) { validate(authentication.getPublicKey(), resultBuilder); } return resultBuilder.build(); }  ValidationResult validate(EnvironmentDto environmentDto); }
EnvironmentAuthenticationValidator { public ValidationResult validate(EnvironmentDto environmentDto) { ValidationResult.ValidationResultBuilder resultBuilder = ValidationResult.builder(); AuthenticationDto authentication = environmentDto.getAuthentication(); if (!StringUtils.hasText(authentication.getPublicKeyId())) { validate(authentication.getPublicKey(), resultBuilder); } return resultBuilder.build(); }  ValidationResult validate(EnvironmentDto environmentDto);  }