X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=capifcore%2Finternal%2Fprovidermanagementapi%2Ftypevalidation_test.go;h=a5a4e3c62e3a8981e1c3f75dc4db884328ceb8ce;hb=refs%2Fchanges%2F04%2F10404%2F1;hp=7698aab4b1367499a80932f8891e63f949a4aa3a;hpb=8a4c1cda83ec4c3ff7fabc7591278dfe90e18c18;p=nonrtric%2Fplt%2Fsme.git diff --git a/capifcore/internal/providermanagementapi/typevalidation_test.go b/capifcore/internal/providermanagementapi/typevalidation_test.go index 7698aab..a5a4e3c 100644 --- a/capifcore/internal/providermanagementapi/typevalidation_test.go +++ b/capifcore/internal/providermanagementapi/typevalidation_test.go @@ -106,6 +106,21 @@ func TestValidateAPIProviderEnrolmentDetails(t *testing.T) { assert.Nil(t, providerDetailsUnderTest.Validate()) } +func TestValidateAlreadyRegistered(t *testing.T) { + regSec := "regSec" + providerUnderTest := APIProviderEnrolmentDetails{ + RegSec: regSec, + } + + otherProvider := APIProviderEnrolmentDetails{ + RegSec: "otherRegSec", + } + assert.Nil(t, providerUnderTest.ValidateAlreadyRegistered(otherProvider)) + + otherProvider.RegSec = regSec + assert.NotNil(t, providerUnderTest.ValidateAlreadyRegistered(otherProvider)) +} + func getProvider() APIProviderEnrolmentDetails { testFuncs := []APIProviderFunctionDetails{ {