Improve validation for invoker management
[nonrtric/plt/sme.git] / capifcore / internal / invokermanagementapi / typevalidation_test.go
index 60e4ee5..58cd655 100644 (file)
@@ -35,7 +35,14 @@ func TestValidateInvoker(t *testing.T) {
                assert.Contains(t, err.Error(), "NotificationDestination")
        }
 
-       invokerUnderTest.NotificationDestination = "destination"
+       invokerUnderTest.NotificationDestination = "invalid dest"
+       err = invokerUnderTest.Validate()
+       if assert.Error(t, err) {
+               assert.Contains(t, err.Error(), "invalid")
+               assert.Contains(t, err.Error(), "NotificationDestination")
+       }
+
+       invokerUnderTest.NotificationDestination = "http://golang.cafe/"
        err = invokerUnderTest.Validate()
        if assert.Error(t, err) {
                assert.Contains(t, err.Error(), "missing")