@@ -58,7 +58,7 @@ func TestBatch2EWithDB(t *testing.T) {
5858 s .callbacks .On ("UUIDCollectionNSEvent" , database .CollectionBatches , fftypes .ChangeEventTypeCreated , "ns1" , batchID , mock .Anything ).Return ()
5959 s .callbacks .On ("UUIDCollectionNSEvent" , database .CollectionBatches , fftypes .ChangeEventTypeUpdated , "ns1" , batchID , mock .Anything ).Return ()
6060
61- err := s .UpsertBatch (ctx , batch , true , true )
61+ err := s .UpsertBatch (ctx , batch , true )
6262 assert .NoError (t , err )
6363
6464 // Check we get the exact same batch back
@@ -96,10 +96,10 @@ func TestBatch2EWithDB(t *testing.T) {
9696 }
9797
9898 // Rejects hash change
99- err = s .UpsertBatch (context .Background (), batchUpdated , true , false )
99+ err = s .UpsertBatch (context .Background (), batchUpdated , false )
100100 assert .Equal (t , database .HashMismatch , err )
101101
102- err = s .UpsertBatch (context .Background (), batchUpdated , true , true )
102+ err = s .UpsertBatch (context .Background (), batchUpdated , true )
103103 assert .NoError (t , err )
104104
105105 // Check we get the exact same message back - note the removal of one of the batch elements
@@ -155,7 +155,7 @@ func TestBatch2EWithDB(t *testing.T) {
155155func TestUpsertBatchFailBegin (t * testing.T ) {
156156 s , mock := newMockProvider ().init ()
157157 mock .ExpectBegin ().WillReturnError (fmt .Errorf ("pop" ))
158- err := s .UpsertBatch (context .Background (), & fftypes.Batch {}, true , true )
158+ err := s .UpsertBatch (context .Background (), & fftypes.Batch {}, true )
159159 assert .Regexp (t , "FF10114" , err )
160160 assert .NoError (t , mock .ExpectationsWereMet ())
161161}
@@ -166,7 +166,7 @@ func TestUpsertBatchFailSelect(t *testing.T) {
166166 mock .ExpectQuery ("SELECT .*" ).WillReturnError (fmt .Errorf ("pop" ))
167167 mock .ExpectRollback ()
168168 batchID := fftypes .NewUUID ()
169- err := s .UpsertBatch (context .Background (), & fftypes.Batch {ID : batchID }, true , true )
169+ err := s .UpsertBatch (context .Background (), & fftypes.Batch {ID : batchID }, true )
170170 assert .Regexp (t , "FF10115" , err )
171171 assert .NoError (t , mock .ExpectationsWereMet ())
172172}
@@ -178,7 +178,7 @@ func TestUpsertBatchFailInsert(t *testing.T) {
178178 mock .ExpectExec ("INSERT .*" ).WillReturnError (fmt .Errorf ("pop" ))
179179 mock .ExpectRollback ()
180180 batchID := fftypes .NewUUID ()
181- err := s .UpsertBatch (context .Background (), & fftypes.Batch {ID : batchID }, true , true )
181+ err := s .UpsertBatch (context .Background (), & fftypes.Batch {ID : batchID }, true )
182182 assert .Regexp (t , "FF10116" , err )
183183 assert .NoError (t , mock .ExpectationsWereMet ())
184184}
@@ -190,7 +190,7 @@ func TestUpsertBatchFailUpdate(t *testing.T) {
190190 mock .ExpectQuery ("SELECT .*" ).WillReturnRows (sqlmock .NewRows ([]string {"id" }).AddRow (batchID .String ()))
191191 mock .ExpectExec ("UPDATE .*" ).WillReturnError (fmt .Errorf ("pop" ))
192192 mock .ExpectRollback ()
193- err := s .UpsertBatch (context .Background (), & fftypes.Batch {ID : batchID }, true , true )
193+ err := s .UpsertBatch (context .Background (), & fftypes.Batch {ID : batchID }, true )
194194 assert .Regexp (t , "FF10117" , err )
195195 assert .NoError (t , mock .ExpectationsWereMet ())
196196}
@@ -202,7 +202,7 @@ func TestUpsertBatchFailCommit(t *testing.T) {
202202 mock .ExpectQuery ("SELECT .*" ).WillReturnRows (sqlmock .NewRows ([]string {"id" }))
203203 mock .ExpectExec ("INSERT .*" ).WillReturnResult (sqlmock .NewResult (1 , 1 ))
204204 mock .ExpectCommit ().WillReturnError (fmt .Errorf ("pop" ))
205- err := s .UpsertBatch (context .Background (), & fftypes.Batch {ID : batchID }, true , true )
205+ err := s .UpsertBatch (context .Background (), & fftypes.Batch {ID : batchID }, true )
206206 assert .Regexp (t , "FF10119" , err )
207207 assert .NoError (t , mock .ExpectationsWereMet ())
208208}
0 commit comments