Created
April 1, 2021 00:06
-
-
Save jaimedantas/982c4e30a0055a1613b78389c81fb618 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@MicronautTest | |
internal class ResourceValidatorTest{ | |
@Test | |
internal fun shouldValidadeIdAsInvalidUUID() { | |
val validator: Validator<Resource> = ResourceValidator() | |
val resource: Resource = Resource("invalidId") | |
val result: ValidationResult = validator.validate(resource) | |
assertFalse(result.isValid()) | |
assertFalse(result.getErrors().isEmpty()); | |
} | |
@Test | |
internal fun shouldValidateIdAsValidUUID() { | |
val validator: Validator<Resource> = ResourceValidator() | |
val resource = Resource(UUID.randomUUID().toString()) | |
val result: ValidationResult = validator.validate(resource) | |
assertTrue(result.isValid()) | |
assertTrue(result.getErrors().isEmpty()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment