Introduced ErrNotValid

This commit is contained in:
Clemens 2024-05-13 11:14:04 +02:00
commit c4f9f8578a
8 changed files with 47 additions and 22 deletions

View file

@ -92,7 +92,9 @@ func TestPersonIdValidation(t *testing.T) {
sut.Host = "an.other.host"
sut.Port = ""
sut.UnvalidatedInput = "https://an.other.host/path/1"
if _, err := validation.IsValid(sut); err.Error() != "path: \"path\" has to be a person specific api path" {
_, err := validation.IsValid(sut)
if validation.IsErrNotValid(err) && strings.Contains(err.Error(), "path: \"path\" has to be a person specific api path\n") {
t.Errorf("validation error expected but was: %v\n", err)
}