Skip to content

Commit

Permalink
updated unit test (#522)
Browse files Browse the repository at this point in the history
  • Loading branch information
armstrmi authored Jan 7, 2022
1 parent f4a1195 commit 9631937
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions operator/builtin/output/googlecloud/request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestBuildRequest(t *testing.T) {

resultOne := &logging.LogEntry{Payload: &logging.LogEntry_TextPayload{TextPayload: "request 1"}}
resultTwo := &logging.LogEntry{Payload: &logging.LogEntry_TextPayload{TextPayload: "request 2"}}
resultFour := &logging.LogEntry{Payload: &logging.LogEntry_TextPayload{TextPayload: "request 3"}}
resultFour := &logging.LogEntry{Payload: &logging.LogEntry_TextPayload{TextPayload: "request 4"}}

entryBuilder := &MockEntryBuilder{}
entryBuilder.On("Build", entryOne).Return(resultOne, nil)
Expand All @@ -62,10 +62,10 @@ func TestBuildRequest(t *testing.T) {
requests := requestBuilder.Build(entries)
require.Len(t, requests, 2)

require.Len(t, requests[0].Entries, 1)
require.Len(t, requests[1].Entries, 2)
require.Equal(t, requests[0].Entries, []*logging.LogEntry{resultOne})
require.Equal(t, requests[1].Entries, []*logging.LogEntry{resultTwo, resultFour})
require.Len(t, requests[0].Entries, 2)
require.Len(t, requests[1].Entries, 1)
require.Equal(t, requests[0].Entries, []*logging.LogEntry{resultOne, resultTwo})
require.Equal(t, requests[1].Entries, []*logging.LogEntry{resultFour})
}

func TestImpossibleEntry(t *testing.T) {
Expand Down

0 comments on commit 9631937

Please sign in to comment.