@@ -196,7 +196,7 @@ private void executeUpdate(long expectedCount, final String... stmts) {
196
196
};
197
197
TransactionRunner runner = getClient ().readWriteTransaction ();
198
198
Long rowCount = runner .run (callable );
199
- assertEquals (rowCount , (Long ) expectedCount );
199
+ assertEquals ((Long ) expectedCount , rowCount );
200
200
}
201
201
202
202
@ Test
@@ -217,7 +217,7 @@ private void executeUpdateAsync(long expectedCount, final String... stmts) {
217
217
};
218
218
TransactionRunner runner = getClient ().readWriteTransaction ();
219
219
Long rowCount = runner .run (callable );
220
- assertEquals (rowCount , (Long ) expectedCount );
220
+ assertEquals ((Long ) expectedCount , rowCount );
221
221
}
222
222
223
223
@ Test
@@ -226,36 +226,36 @@ public void dmlReturningWithExecutePartitionedUpdate() {
226
226
assertThrows (
227
227
SpannerException .class ,
228
228
() -> getClient ().executePartitionedUpdate (Statement .of (updateDmlReturning ())));
229
- assertEquals (e .getErrorCode (), ErrorCode . UNIMPLEMENTED );
229
+ assertEquals (ErrorCode . UNIMPLEMENTED , e .getErrorCode ());
230
230
}
231
231
232
232
@ Test
233
233
public void dmlReturningWithExecuteQuery () {
234
234
List <Struct > rows = executeQuery (DML_COUNT , insertDmlReturning ());
235
235
assertEquals (
236
+ 1 ,
236
237
getClient ()
237
238
.singleUse ()
238
239
.readRow ("T" , Key .of (String .format ("%d-boo1" , id )), Collections .singletonList ("V" ))
239
- .getLong (0 ),
240
- 1 );
240
+ .getLong (0 ));
241
241
242
242
// Check if keys(K) and V have expected values.
243
243
for (int idx = 0 ; idx < rows .size (); idx ++) {
244
- assertEquals (rows .get (idx ).getLong ("V" ), idx + 1 );
245
- assertEquals (rows . get ( idx ). getString ( "K" ), String .format ("%d-boo%d" , id , idx + 1 ));
244
+ assertEquals (idx + 1 , rows .get (idx ).getLong ("V" ));
245
+ assertEquals (String .format ("%d-boo%d" , id , idx + 1 ), rows . get ( idx ). getString ( "K" ));
246
246
}
247
247
rows = executeQuery (DML_COUNT , updateDmlReturning ());
248
248
assertEquals (
249
+ 100 ,
249
250
getClient ()
250
251
.singleUse ()
251
252
.readRow ("T" , Key .of (String .format ("%d-boo1" , id )), Collections .singletonList ("V" ))
252
- .getLong (0 ),
253
- 100 );
253
+ .getLong (0 ));
254
254
255
255
// Check if keys(K) and V have expected values.
256
256
for (int idx = 0 ; idx < rows .size (); idx ++) {
257
- assertEquals (rows .get (idx ).getLong ("V" ), 100 );
258
- assertEquals (rows . get ( idx ). getString ( "K" ), String .format ("%d-boo%d" , id , idx + 1 ));
257
+ assertEquals (100 , rows .get (idx ).getLong ("V" ));
258
+ assertEquals (String .format ("%d-boo%d" , id , idx + 1 ), rows . get ( idx ). getString ( "K" ));
259
259
}
260
260
rows = executeQuery (DML_COUNT , deleteDmlReturning ());
261
261
assertNull (
@@ -265,8 +265,8 @@ public void dmlReturningWithExecuteQuery() {
265
265
266
266
// Check if keys(K) and V have expected values.
267
267
for (int idx = 0 ; idx < rows .size (); idx ++) {
268
- assertEquals (rows .get (idx ).getLong ("V" ), 100 );
269
- assertEquals (rows . get ( idx ). getString ( "K" ), String .format ("%d-boo%d" , id , idx + 1 ));
268
+ assertEquals (100 , rows .get (idx ).getLong ("V" ));
269
+ assertEquals (String .format ("%d-boo%d" , id , idx + 1 ), rows . get ( idx ). getString ( "K" ));
270
270
}
271
271
}
272
272
@@ -296,29 +296,29 @@ private List<Struct> executeQuery(long expectedCount, String stmt) {
296
296
public void dmlReturningWithExecuteQueryAsync () {
297
297
List <Struct > rows = executeQueryAsync (DML_COUNT , insertDmlReturning ());
298
298
assertEquals (
299
+ 1 ,
299
300
getClient ()
300
301
.singleUse ()
301
302
.readRow ("T" , Key .of (String .format ("%d-boo1" , id )), Collections .singletonList ("V" ))
302
- .getLong (0 ),
303
- 1 );
303
+ .getLong (0 ));
304
304
305
305
// Check if keys(K) and V have expected values.
306
306
for (int idx = 0 ; idx < rows .size (); idx ++) {
307
- assertEquals (rows .get (idx ).getLong ("V" ), idx + 1 );
308
- assertEquals (rows . get ( idx ). getString ( "K" ), String .format ("%d-boo%d" , id , idx + 1 ));
307
+ assertEquals (idx + 1 , rows .get (idx ).getLong ("V" ));
308
+ assertEquals (String .format ("%d-boo%d" , id , idx + 1 ), rows . get ( idx ). getString ( "K" ));
309
309
}
310
310
rows = executeQueryAsync (DML_COUNT , updateDmlReturning ());
311
311
assertEquals (
312
+ 100 ,
312
313
getClient ()
313
314
.singleUse ()
314
315
.readRow ("T" , Key .of (String .format ("%d-boo1" , id )), Collections .singletonList ("V" ))
315
- .getLong (0 ),
316
- 100 );
316
+ .getLong (0 ));
317
317
318
318
// Check if keys(K) and V have expected values.
319
319
for (int idx = 0 ; idx < rows .size (); idx ++) {
320
- assertEquals (rows .get (idx ).getLong ("V" ), 100 );
321
- assertEquals (rows . get ( idx ). getString ( "K" ), String .format ("%d-boo%d" , id , idx + 1 ));
320
+ assertEquals (100 , rows .get (idx ).getLong ("V" ));
321
+ assertEquals (String .format ("%d-boo%d" , id , idx + 1 ), rows . get ( idx ). getString ( "K" ));
322
322
}
323
323
rows = executeQueryAsync (DML_COUNT , deleteDmlReturning ());
324
324
assertNull (
@@ -328,8 +328,8 @@ public void dmlReturningWithExecuteQueryAsync() {
328
328
329
329
// Check if keys(K) and V have expected values.
330
330
for (int idx = 0 ; idx < rows .size (); idx ++) {
331
- assertEquals (rows .get (idx ).getLong ("V" ), 100 );
332
- assertEquals (rows . get ( idx ). getString ( "K" ), String .format ("%d-boo%d" , id , idx + 1 ));
331
+ assertEquals (100 , rows .get (idx ).getLong ("V" ));
332
+ assertEquals (String .format ("%d-boo%d" , id , idx + 1 ), rows . get ( idx ). getString ( "K" ));
333
333
}
334
334
}
335
335
@@ -373,10 +373,10 @@ private List<Struct> executeQueryAsync(long expectedCount, String stmt) {
373
373
public void dmlReturningWithBatchUpdate () {
374
374
// Check if batchUpdate works well with a mix of Simple DML and DML Returning statements.
375
375
long [] rowCounts = batchUpdate (insertDmlReturning (), updateDmlReturning (), deleteDml ());
376
- assertEquals (rowCounts .length , 3 );
377
- assertEquals (rowCounts [0 ], DML_COUNT );
378
- assertEquals (rowCounts [1 ], DML_COUNT );
379
- assertEquals (rowCounts [2 ], DML_COUNT );
376
+ assertEquals (3 , rowCounts .length );
377
+ assertEquals (DML_COUNT , rowCounts [0 ]);
378
+ assertEquals (DML_COUNT , rowCounts [1 ]);
379
+ assertEquals (DML_COUNT , rowCounts [2 ]);
380
380
}
381
381
382
382
private long [] batchUpdate (final String ... stmts ) {
@@ -392,10 +392,10 @@ private long[] batchUpdate(final String... stmts) {
392
392
public void dmlReturningWithBatchUpdateAsync () {
393
393
// Check if batchUpdateAsync works well with a mix of Simple DML and DML Returning statements.
394
394
long [] rowCounts = batchUpdateAsync (insertDmlReturning (), updateDmlReturning (), deleteDml ());
395
- assertEquals (rowCounts .length , 3 );
396
- assertEquals (rowCounts [0 ], DML_COUNT );
397
- assertEquals (rowCounts [1 ], DML_COUNT );
398
- assertEquals (rowCounts [2 ], DML_COUNT );
395
+ assertEquals (3 , rowCounts .length );
396
+ assertEquals (DML_COUNT , rowCounts [0 ]);
397
+ assertEquals (DML_COUNT , rowCounts [1 ]);
398
+ assertEquals (DML_COUNT , rowCounts [2 ]);
399
399
}
400
400
401
401
private long [] batchUpdateAsync (final String ... stmts ) {
0 commit comments