From: elinuxhenrik Date: Mon, 25 Oct 2021 06:06:25 +0000 (+0200) Subject: Fix test of DMaaP Mediator Producer X-Git-Tag: 1.2.0~67 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;ds=sidebyside;h=121fa6b1a25f0b3acdda8122362d6880c04b0a3d;hp=--cc;p=nonrtric.git Fix test of DMaaP Mediator Producer Issue-ID: NONRTRIC-612 Signed-off-by: elinuxhenrik Change-Id: Ib94010a9be3a6b2e85f6627cb19265177725f9dc --- 121fa6b1a25f0b3acdda8122362d6880c04b0a3d diff --git a/dmaap-mediator-producer/internal/jobs/jobs_test.go b/dmaap-mediator-producer/internal/jobs/jobs_test.go index 9fe27c3e..8533719e 100644 --- a/dmaap-mediator-producer/internal/jobs/jobs_test.go +++ b/dmaap-mediator-producer/internal/jobs/jobs_test.go @@ -165,6 +165,7 @@ func TestDeleteJob(t *testing.T) { func TestPollAndDistributeMessages(t *testing.T) { assertions := require.New(t) + wg := sync.WaitGroup{} messages := `[{"message": {"data": "data"}}]` pollClientMock := NewTestClient(func(req *http.Request) *http.Response { if req.URL.String() == "http://mrAddr/topicUrl" { @@ -196,7 +197,9 @@ func TestPollAndDistributeMessages(t *testing.T) { t.Fail() return nil }) + handlerUnderTest := NewJobHandlerImpl("", pollClientMock, distributeClientMock) + jobInfo := JobInfo{ InfoTypeIdentity: "type1", InfoJobIdentity: "job1", @@ -211,7 +214,6 @@ func TestPollAndDistributeMessages(t *testing.T) { handlerUnderTest.clearAll() }) - wg := sync.WaitGroup{} wg.Add(2) // Two calls should be made to the server, one to poll and one to distribute handlerUnderTest.pollAndDistributeMessages("http://mrAddr")