X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=capifcore%2Finternal%2Finvokermanagementapi%2Ftypevalidation_test.go;h=499b0a12ee8ea976394c80628dc108a771d98ee3;hb=refs%2Fchanges%2F96%2F10396%2F1;hp=58cd655ee26162c964bcca0c1fbdd27cc1fab009;hpb=4e2b0618206193e13ba73831b6d6cb866e1d1dae;p=nonrtric%2Fplt%2Fsme.git diff --git a/capifcore/internal/invokermanagementapi/typevalidation_test.go b/capifcore/internal/invokermanagementapi/typevalidation_test.go index 58cd655..499b0a1 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 TestIsOnboarded(t *testing.T) { + publicKey := "publicKey" + invokerUnderTest := APIInvokerEnrolmentDetails{ + OnboardingInformation: OnboardingInformation{ + ApiInvokerPublicKey: publicKey, + }, + } + + otherInvoker := APIInvokerEnrolmentDetails{ + OnboardingInformation: OnboardingInformation{ + ApiInvokerPublicKey: "otherPublicKey", + }, + } + assert.False(t, invokerUnderTest.IsOnboarded(otherInvoker)) + + otherInvoker.OnboardingInformation.ApiInvokerPublicKey = publicKey + assert.True(t, invokerUnderTest.IsOnboarded(otherInvoker)) +}