Roll versions after J-Relase (master branch)
[nonrtric/plt/sme.git] / capifcore / internal / publishserviceapi / typevalidation_test.go
index ef4e35b..d7b59d5 100644 (file)
@@ -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))
+}