Skip to content

Commit

Permalink
Use mock assignment logger and verify it is being called (FF-1450) (#30)
Browse files Browse the repository at this point in the history
* Use mock assignment logger and verify it is being called (FF-1450)

* Use passed logger from configuration.
  • Loading branch information
leoromanovsky committed Jan 12, 2024
1 parent 3326c3f commit 6a66776
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions eppoclient/eppoclient_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
)

const TEST_DATA_DIR = "test-data/assignment-v2"
Expand All @@ -22,8 +23,9 @@ var tstData = []testData{}
func Test_e2e(t *testing.T) {
serverUrl := initFixture()

asmntLogger := &AssignmentLogger{}
client := InitClient(Config{BaseUrl: serverUrl, ApiKey: "dummy", AssignmentLogger: asmntLogger})
mockLogger := new(mockLogger)
mockLogger.Mock.On("LogAssignment", mock.Anything).Return()
client := InitClient(Config{BaseUrl: serverUrl, ApiKey: "dummy", AssignmentLogger: mockLogger})

time.Sleep(2 * time.Second)

Expand Down Expand Up @@ -128,6 +130,8 @@ func Test_e2e(t *testing.T) {
}
assert.Equal(t, expectedAssignments, stringAssignments)
}

mockLogger.AssertCalled(t, "LogAssignment", mock.Anything)
}
}

Expand Down

0 comments on commit 6a66776

Please sign in to comment.