X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=capifcore%2Finternal%2Fpublishserviceapi%2Ftypevalidation_test.go;h=d7b59d5a3b8bfac81d05267a28925f227c372d47;hb=refs%2Fchanges%2F85%2F12585%2F1;hp=ef4e35b88a9c10990ac18ab1485a6bfa94a2a962;hpb=803745b67e70e58cb8731e3a377c4d6b8f800e51;p=nonrtric%2Fplt%2Fsme.git diff --git a/capifcore/internal/publishserviceapi/typevalidation_test.go b/capifcore/internal/publishserviceapi/typevalidation_test.go index ef4e35b..d7b59d5 100644 --- a/capifcore/internal/publishserviceapi/typevalidation_test.go +++ b/capifcore/internal/publishserviceapi/typevalidation_test.go @@ -38,3 +38,18 @@ func TestValidate(t *testing.T) { assert.Nil(t, err) } + +func TestValidateAlreadyPublished(t *testing.T) { + apiName := "apiName" + serviceUnderTest := ServiceAPIDescription{ + ApiName: apiName, + } + + otherService := ServiceAPIDescription{ + ApiName: "otherApiName", + } + assert.Nil(t, serviceUnderTest.ValidateAlreadyPublished(otherService)) + + otherService.ApiName = apiName + assert.NotNil(t, serviceUnderTest.ValidateAlreadyPublished(otherService)) +}