Skip to content

Commit e506d89

Browse files
committed
add test
1 parent ce6ee81 commit e506d89

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

discovery/client_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,20 @@ func Test_clientUpdater_update(t *testing.T) {
136136
wg.Wait()
137137
})
138138
}
139+
140+
func Test_clientUpdater_doUpdate(t *testing.T) {
141+
t.Run("proceeds when service update fails", func(t *testing.T) {
142+
storageEngine := storage.NewTestStorageEngine(t)
143+
require.NoError(t, storageEngine.Start())
144+
store := setupStore(t, storageEngine.GetSQLDatabase())
145+
ctrl := gomock.NewController(t)
146+
verifier := NewMockregistrationVerifier(ctrl)
147+
httpClient := client.NewMockHTTPClient(ctrl)
148+
newTag := "test"
149+
httpClient.EXPECT().Get(gomock.Any(), gomock.Any(), gomock.Any()).Return([]vc.VerifiablePresentation{}, &newTag, nil)
150+
httpClient.EXPECT().Get(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil, nil, errors.New("test"))
151+
updater := newClientUpdater(testDefinitions(), store, verifier, httpClient)
152+
153+
updater.doUpdate(context.Background())
154+
})
155+
}

0 commit comments

Comments
 (0)