X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=capifcore%2Finternal%2Finvokermanagement%2Finvokermanagement_test.go;h=d3c386c6361b2b264f69f21a345aefbd6ea0d193;hb=b8e717a8c264a8b3f73626fc28c81ae65283ae80;hp=4613cc4144891857b3bd728c82cc1c7d0e2f4d54;hpb=48a943de59afa094d586cee17b313f1de5ecbaf2;p=nonrtric%2Fplt%2Fsme.git diff --git a/capifcore/internal/invokermanagement/invokermanagement_test.go b/capifcore/internal/invokermanagement/invokermanagement_test.go index 4613cc4..d3c386c 100644 --- a/capifcore/internal/invokermanagement/invokermanagement_test.go +++ b/capifcore/internal/invokermanagement/invokermanagement_test.go @@ -80,7 +80,7 @@ func TestOnboardInvoker(t *testing.T) { assert.True(t, invokerUnderTest.VerifyInvokerSecret(wantedInvokerId, wantedInvokerSecret)) publishRegisterMock.AssertCalled(t, "GetAllPublishedServices") assert.Equal(t, invokermanagementapi.APIList(publishedServices), *resultInvoker.ApiList) - if invokerEvent, ok := waitForEvent(eventChannel, 1*time.Second); ok { + if invokerEvent, timeout := waitForEvent(eventChannel, 1*time.Second); timeout { assert.Fail(t, "No event sent") } else { assert.Equal(t, *resultInvoker.ApiInvokerId, (*invokerEvent.EventDetail.ApiInvokerIds)[0]) @@ -138,7 +138,7 @@ func TestDeleteInvoker(t *testing.T) { assert.Equal(t, http.StatusNoContent, result.Code()) assert.False(t, invokerUnderTest.IsInvokerRegistered(invokerId)) - if invokerEvent, ok := waitForEvent(eventChannel, 1*time.Second); ok { + if invokerEvent, timeout := waitForEvent(eventChannel, 1*time.Second); timeout { assert.Fail(t, "No event sent") } else { assert.Equal(t, invokerId, (*invokerEvent.EventDetail.ApiInvokerIds)[0]) @@ -220,7 +220,7 @@ func TestUpdateInvoker(t *testing.T) { assert.Contains(t, *problemDetails.Cause, "not matching") assert.Contains(t, *problemDetails.Cause, "ApiInvokerId") - // Update an invoker that has not been onboarded, shold get 404 with problem details + // Update an invoker that has not been onboarded, should get 404 with problem details missingId := "1" invoker.ApiInvokerId = &missingId result = testutil.NewRequest().Put("/onboardedInvokers/"+missingId).WithJsonBody(invoker).Go(t, requestHandler)