X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=capifcore%2Finternal%2Finvokermanagement%2Finvokermanagement_test.go;h=ae79c905bf0d422dbfbc0a9a0767e87299fb1ff7;hb=822868729fe2af05b983f1fa16546bbcbfa2b465;hp=b46e925a2bea3479726ccfc90c7609c48277eb89;hpb=4974b9d1c7256e90cb206b327b0c81f7364beeab;p=nonrtric%2Fplt%2Fsme.git diff --git a/capifcore/internal/invokermanagement/invokermanagement_test.go b/capifcore/internal/invokermanagement/invokermanagement_test.go index b46e925..ae79c90 100644 --- a/capifcore/internal/invokermanagement/invokermanagement_test.go +++ b/capifcore/internal/invokermanagement/invokermanagement_test.go @@ -3,7 +3,8 @@ // ========================LICENSE_START================================= // O-RAN-SC // %% -// Copyright (C) 2022: Nordix Foundation +// Copyright (C) 2022-2023: Nordix Foundation +// Copyright (C) 2024: OpenInfra Foundation Europe // %% // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -64,7 +65,7 @@ func TestOnboardInvoker(t *testing.T) { var client keycloak.Client client.Secret = &wantedInvokerSecret publishRegisterMock := publishmocks.PublishRegister{} - publishRegisterMock.On("GetAllPublishedServices").Return(publishedServices) + publishRegisterMock.On("GetAllowedPublishedServices", mock.AnythingOfType("[]publishserviceapi.ServiceAPIDescription")).Return(publishedServices) accessMgmMock := keycloackmocks.AccessManagement{} accessMgmMock.On("AddClient", mock.AnythingOfType("string"), mock.AnythingOfType("string")).Return(nil) @@ -90,7 +91,9 @@ func TestOnboardInvoker(t *testing.T) { assert.Equal(t, "http://example.com/onboardedInvokers/"+*resultInvoker.ApiInvokerId, result.Recorder.Header().Get(echo.HeaderLocation)) assert.True(t, invokerUnderTest.IsInvokerRegistered(wantedInvokerId)) assert.True(t, invokerUnderTest.VerifyInvokerSecret(wantedInvokerId, wantedInvokerSecret)) - publishRegisterMock.AssertCalled(t, "GetAllPublishedServices") + + publishRegisterMock.AssertCalled(t, "GetAllowedPublishedServices", mock.AnythingOfType("[]publishserviceapi.ServiceAPIDescription")) + assert.Equal(t, invokermanagementapi.APIList(publishedServices), *resultInvoker.ApiList) if invokerEvent, timeout := waitForEvent(eventChannel, 1*time.Second); timeout { assert.Fail(t, "No event sent")