Skip to content

Commit

Permalink
Added one more test
Browse files Browse the repository at this point in the history
  • Loading branch information
gotha committed Dec 6, 2019
1 parent a672745 commit 5440a23
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions service/message_handler_test.go
Expand Up @@ -182,6 +182,15 @@ func TestHandleWriteMessage(t *testing.T) {
handler := MessageHandler{esService: serviceMock, ConceptGetter: concordanceApiMock}
handler.handleMessage(consumer.Message{Body: string(inputJSON)})

assert.Equal(1, len(serviceMock.Calls))

data := serviceMock.Calls[0].Arguments.Get(2)
model, ok := data.(content.IndexModel)
if !ok {
assert.Fail("Result is not content.IndexModel")
}
assert.NotEmpty(model.Body)

serviceMock.AssertExpectations(t)
concordanceApiMock.AssertExpectations(t)
}
Expand Down

0 comments on commit 5440a23

Please sign in to comment.