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" {
t.Fail()
return nil
})
+
handlerUnderTest := NewJobHandlerImpl("", pollClientMock, distributeClientMock)
+
jobInfo := JobInfo{
InfoTypeIdentity: "type1",
InfoJobIdentity: "job1",
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")