refactor: don't pass client directly to store syncer

This commit is contained in:
James Houlahan
2020-04-16 17:17:44 +02:00
parent 38f0425670
commit e95aece6d3
10 changed files with 71 additions and 76 deletions

View File

@ -178,7 +178,7 @@ func TestSyncAllMail(t *testing.T) { //nolint[funlen]
}
syncState := newSyncState(store, 0, tc.idRanges, tc.idsToBeDeleted)
err := syncAllMail(m.panicHandler, store, api, syncState)
err := syncAllMail(m.panicHandler, store, func() messageLister { return api }, syncState)
require.Nil(t, err)
// Check all messages were created or updated.
@ -226,7 +226,7 @@ func TestSyncAllMail_FailedListing(t *testing.T) {
}
syncState := newTestSyncState(store)
err := syncAllMail(m.panicHandler, store, api, syncState)
err := syncAllMail(m.panicHandler, store, func() messageLister { return api }, syncState)
require.EqualError(t, err, "failed to sync group: failed to list messages: error")
}
@ -245,7 +245,7 @@ func TestSyncAllMail_FailedCreateOrUpdateMessage(t *testing.T) {
}
syncState := newTestSyncState(store)
err := syncAllMail(m.panicHandler, store, api, syncState)
err := syncAllMail(m.panicHandler, store, func() messageLister { return api }, syncState)
require.EqualError(t, err, "failed to sync group: failed to create or update messages: error")
}