X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=capifcore%2Finternal%2Finvokermanagementapi%2Ftypevalidation_test.go;h=b6b491d0e55066767ff4f6c7d90ab5f4d6c93d49;hb=bf237808ac109b30461a453c59ff4e9cc9b297f4;hp=58cd655ee26162c964bcca0c1fbdd27cc1fab009;hpb=8a4c1cda83ec4c3ff7fabc7591278dfe90e18c18;p=nonrtric%2Fplt%2Fsme.git diff --git a/capifcore/internal/invokermanagementapi/typevalidation_test.go b/capifcore/internal/invokermanagementapi/typevalidation_test.go index 58cd655..b6b491d 100644 --- a/capifcore/internal/invokermanagementapi/typevalidation_test.go +++ b/capifcore/internal/invokermanagementapi/typevalidation_test.go @@ -53,3 +53,22 @@ func TestValidateInvoker(t *testing.T) { err = invokerUnderTest.Validate() assert.Nil(t, err) } + +func TestValidateAlreadyOnboarded(t *testing.T) { + publicKey := "publicKey" + invokerUnderTest := APIInvokerEnrolmentDetails{ + OnboardingInformation: OnboardingInformation{ + ApiInvokerPublicKey: publicKey, + }, + } + + otherInvoker := APIInvokerEnrolmentDetails{ + OnboardingInformation: OnboardingInformation{ + ApiInvokerPublicKey: "otherPublicKey", + }, + } + assert.Nil(t, invokerUnderTest.ValidateAlreadyOnboarded(otherInvoker)) + + otherInvoker.OnboardingInformation.ApiInvokerPublicKey = publicKey + assert.NotNil(t, invokerUnderTest.ValidateAlreadyOnboarded(otherInvoker)) +}