@@ -167,44 +167,44 @@ public void testRowDeletes() {
167
167
assertThat (t1 .changeOrdinal ()).as ("Ordinal must match" ).isEqualTo (0 );
168
168
assertThat (t1 .commitSnapshotId ()).as ("Snapshot must match" ).isEqualTo (snap2 .snapshotId ());
169
169
assertThat (t1 .file ().path ()).as ("Data file must match" ).isEqualTo (FILE_B .path ());
170
- assertThat (t1 .addedDeletes ().get (0 ).path ())
171
- .as ("Added delete file must match" )
172
- .isEqualTo (FILE_B_DELETES .path ());
170
+ assertThat (t1 .addedDeletes ())
171
+ .hasSize (1 )
172
+ .extracting (DeleteFile ::path )
173
+ .as ("Added delete files must match" )
174
+ .containsExactly (FILE_B_DELETES .path ());
173
175
assertThat (t1 .existingDeletes ()).as ("Must be no existing deletes" ).isEmpty ();
174
176
175
177
DeletedRowsScanTask t2 = (DeletedRowsScanTask ) tasks .get (1 );
176
178
assertThat (t2 .changeOrdinal ()).as ("Ordinal must match" ).isEqualTo (1 );
177
179
assertThat (t2 .commitSnapshotId ()).as ("Snapshot must match" ).isEqualTo (snap3 .snapshotId ());
178
180
assertThat (t2 .file ().path ()).as ("Data file must match" ).isEqualTo (FILE_C .path ());
179
- assertThat (t2 .addedDeletes ().get (0 ).path ())
180
- .as ("Added delete file must match" )
181
- .isEqualTo (FILE_C2_DELETES .path ());
181
+ assertThat (t2 .addedDeletes ())
182
+ .hasSize (1 )
183
+ .extracting (DeleteFile ::path )
184
+ .as ("Added delete files must match" )
185
+ .containsExactly (FILE_C2_DELETES .path ());
182
186
assertThat (t2 .existingDeletes ()).as ("Must be no existing deletes" ).isEmpty ();
183
187
184
188
DeletedRowsScanTask t3 = (DeletedRowsScanTask ) tasks .get (2 );
185
189
assertThat (t3 .changeOrdinal ()).as ("Ordinal must match" ).isEqualTo (2 );
186
190
assertThat (t3 .commitSnapshotId ()).as ("Snapshot must match" ).isEqualTo (snap4 .snapshotId ());
187
191
assertThat (t3 .file ().path ()).as ("Data file must match" ).isEqualTo (FILE_A2 .path ());
188
- assertThat (t3 .addedDeletes ().size ()).as ("Number of added delete files must match" ).isEqualTo (2 );
189
- assertThat (t3 .addedDeletes ().get (0 ).path ())
190
- .as ("Added delete file must match" )
191
- .isEqualTo (FILE_A2_DELETES .path ());
192
- assertThat (t3 .addedDeletes ().get (1 ).path ())
193
- .as ("Added delete file must match" )
194
- .isEqualTo (FILE_A_DELETES .path ());
192
+ assertThat (t3 .addedDeletes ())
193
+ .hasSize (2 )
194
+ .extracting (DeleteFile ::path )
195
+ .as ("Added delete files must match" )
196
+ .containsExactlyInAnyOrder (FILE_A2_DELETES .path (), FILE_A_DELETES .path ());
195
197
assertThat (t3 .existingDeletes ()).as ("Must be no existing deletes" ).isEmpty ();
196
198
197
199
DeletedRowsScanTask t4 = (DeletedRowsScanTask ) tasks .get (3 );
198
200
assertThat (t4 .changeOrdinal ()).as ("Ordinal must match" ).isEqualTo (2 );
199
201
assertThat (t4 .commitSnapshotId ()).as ("Snapshot must match" ).isEqualTo (snap4 .snapshotId ());
200
202
assertThat (t4 .file ().path ()).as ("Data file must match" ).isEqualTo (FILE_A .path ());
201
- assertThat (t4 .addedDeletes ().size ()).as ("Number of added delete files must match" ).isEqualTo (2 );
202
- assertThat (t4 .addedDeletes ().get (0 ).path ())
203
- .as ("Added delete file must match" )
204
- .isEqualTo (FILE_A2_DELETES .path ());
205
- assertThat (t4 .addedDeletes ().get (1 ).path ())
206
- .as ("Added delete file must match" )
207
- .isEqualTo (FILE_A_DELETES .path ());
203
+ assertThat (t4 .addedDeletes ())
204
+ .hasSize (2 )
205
+ .extracting (DeleteFile ::path )
206
+ .as ("Added delete files must match" )
207
+ .containsExactlyInAnyOrder (FILE_A2_DELETES .path (), FILE_A_DELETES .path ());
208
208
assertThat (t4 .existingDeletes ()).as ("Must be no existing deletes" ).isEmpty ();
209
209
}
210
210
@@ -229,9 +229,11 @@ public void testAddingAndDeletingInSameCommit() {
229
229
assertThat (t1 .changeOrdinal ()).as ("Ordinal must match" ).isEqualTo (0 );
230
230
assertThat (t1 .commitSnapshotId ()).as ("Snapshot must match" ).isEqualTo (snap2 .snapshotId ());
231
231
assertThat (t1 .file ().path ()).as ("Data file must match" ).isEqualTo (FILE_B .path ());
232
- assertThat (t1 .deletes ().get (0 ).path ())
233
- .as ("Delete file must match" )
234
- .isEqualTo (FILE_B_DELETES .path ());
232
+ assertThat (t1 .deletes ())
233
+ .hasSize (1 )
234
+ .extracting (DeleteFile ::path )
235
+ .as ("Delete files must match" )
236
+ .containsExactly (FILE_B_DELETES .path ());
235
237
}
236
238
237
239
@ TestTemplate
@@ -258,16 +260,16 @@ public void testDeletingRowsInDataFileWithExistingDeletes() {
258
260
assertThat (t1 .changeOrdinal ()).as ("Ordinal must match" ).isEqualTo (0 );
259
261
assertThat (t1 .commitSnapshotId ()).as ("Snapshot must match" ).isEqualTo (snap3 .snapshotId ());
260
262
assertThat (t1 .file ().path ()).as ("Data file must match" ).isEqualTo (FILE_A .path ());
261
- assertThat (t1 .addedDeletes (). size ()). as ( "Number of added delete files must match" ). isEqualTo ( 1 );
262
- assertThat ( t1 . addedDeletes (). get ( 0 ). path () )
263
- .as ( "Added delete file must match" )
264
- .isEqualTo ( FILE_A2_DELETES . path ());
265
- assertThat ( t1 . existingDeletes (). size ())
266
- . as ( "Number of existing delete files must match" )
267
- .isEqualTo (1 );
268
- assertThat ( t1 . existingDeletes (). get ( 0 ). path () )
269
- .as ("Existing delete file must match" )
270
- .isEqualTo (FILE_A_DELETES .path ());
263
+ assertThat (t1 .addedDeletes ())
264
+ . hasSize ( 1 )
265
+ .extracting ( DeleteFile :: path )
266
+ .as ( "Added delete files must match" )
267
+ . containsExactly ( FILE_A2_DELETES . path ());
268
+ assertThat ( t1 . existingDeletes () )
269
+ .hasSize (1 )
270
+ . extracting ( DeleteFile :: path )
271
+ .as ("Existing delete files must match" )
272
+ .containsExactly (FILE_A_DELETES .path ());
271
273
}
272
274
273
275
@ TestTemplate
@@ -294,10 +296,11 @@ public void testDeletingDataFileWithExistingDeletes() {
294
296
assertThat (t1 .changeOrdinal ()).as ("Ordinal must match" ).isEqualTo (0 );
295
297
assertThat (t1 .commitSnapshotId ()).as ("Snapshot must match" ).isEqualTo (snap3 .snapshotId ());
296
298
assertThat (t1 .file ().path ()).as ("Data file must match" ).isEqualTo (FILE_B .path ());
297
- assertThat (t1 .existingDeletes ()).hasSize (1 );
298
- assertThat (t1 .existingDeletes ().get (0 ).path ())
299
- .as ("Existing delete file must match" )
300
- .isEqualTo (FILE_B_DELETES .path ());
299
+ assertThat (t1 .existingDeletes ())
300
+ .hasSize (1 )
301
+ .extracting (DeleteFile ::path )
302
+ .as ("Existing delete files must match" )
303
+ .containsExactly (FILE_B_DELETES .path ());
301
304
}
302
305
303
306
@ TestTemplate
0 commit comments