ebyhr commented on code in PR #10632:
URL: https://github.com/apache/iceberg/pull/10632#discussion_r1666506712
##########
flink/v1.19/flink/src/test/java/org/apache/iceberg/flink/source/reader/TestArrayPoolDataIteratorBatcherRowData.java:
##########
@@ -246,52 +265,49 @@ public void testMultipleFilesWithSeekPosition() throws
Exception {
// variable naming convention: batch<fileOffset><batchId>
ArrayBatchRecords<RowData> batch10 = (ArrayBatchRecords<RowData>)
recordBatchIterator.next();
- Assert.assertTrue(batch10.finishedSplits().isEmpty());
- Assert.assertEquals(splitId, batch10.nextSplit());
- // reusable array size should be the configured value of 2
- Assert.assertEquals(2, batch10.records().length);
- // assert actual number of records in the array
- Assert.assertEquals(2, batch10.numberOfRecords());
+ assertThat(batch10.finishedSplits()).isEmpty();
+ assertThat(batch10.nextSplit()).isEqualTo(splitId);
+ assertThat(batch10.records()).hasSize(2);
+ assertThat(batch10.numberOfRecords()).isEqualTo(2);
RecordAndPosition<RowData> recordAndPosition;
recordAndPosition = batch10.nextRecordFromSplit();
- Assert.assertEquals(1, recordAndPosition.fileOffset());
+ assertThat(recordAndPosition.fileOffset()).isEqualTo(1);
// seek should skip the first record in file1. starting from the second
record
- Assert.assertEquals(2, recordAndPosition.recordOffset());
+ assertThat(recordAndPosition.recordOffset()).isEqualTo(2);
TestHelpers.assertRowData(TestFixtures.SCHEMA, records1.get(1),
recordAndPosition.record());
recordAndPosition = batch10.nextRecordFromSplit();
- Assert.assertEquals(1, recordAndPosition.fileOffset());
- // The position points to where the reader should resume after this record
is processed.
- Assert.assertEquals(3, recordAndPosition.recordOffset());
+ assertThat(recordAndPosition.fileOffset()).isEqualTo(1);
+ assertThat(recordAndPosition.recordOffset())
+ .as("The position points to where the reader should resume after this
record is processed.")
+ .isEqualTo(3);
TestHelpers.assertRowData(TestFixtures.SCHEMA, records1.get(2),
recordAndPosition.record());
- Assert.assertNull(batch10.nextRecordFromSplit());
- Assert.assertNull(batch10.nextSplit());
+ assertThat(batch10.nextRecordFromSplit()).isNull();
+ assertThat(batch10.nextSplit()).isNull();
batch10.recycle();
// assert second batch from file1 with partial batch of 1 record
// variable naming convention: batch_<fileOffset>_<batchId>
ArrayBatchRecords<RowData> batch11 = (ArrayBatchRecords<RowData>)
recordBatchIterator.next();
- // assert array is reused
- Assert.assertSame(batch10.records(), batch11.records());
- Assert.assertTrue(batch11.finishedSplits().isEmpty());
- Assert.assertEquals(splitId, batch11.nextSplit());
- // reusable array size should be the configured value of 2
- Assert.assertEquals(2, batch11.records().length);
- // assert actual number of records in the array
- Assert.assertEquals(1, batch11.numberOfRecords());
+ assertThat(batch11.records()).containsExactlyInAnyOrder(batch10.records());
+ assertThat(batch11.finishedSplits()).isEmpty();
+ assertThat(batch11.nextSplit()).isEqualTo(splitId);
+ assertThat(batch11.records()).hasSize(2);
+ assertThat(batch11.numberOfRecords()).isEqualTo(1);
recordAndPosition = batch11.nextRecordFromSplit();
- Assert.assertEquals(1, recordAndPosition.fileOffset());
- // The position points to where the reader should resume after this record
is processed.
- Assert.assertEquals(4, recordAndPosition.recordOffset());
+ assertThat(recordAndPosition.fileOffset()).isEqualTo(1);
+ assertThat(recordAndPosition.recordOffset())
+ .as("The position points to where the reader should resume after this
record is processed.")
+ .isEqualTo(4);
TestHelpers.assertRowData(TestFixtures.SCHEMA, records1.get(3),
recordAndPosition.record());
- Assert.assertNull(batch11.nextRecordFromSplit());
- Assert.assertNull(batch11.nextSplit());
+ assertThat(batch11.nextRecordFromSplit()).isNull();
+ assertThat(batch11.nextSplit());
Review Comment:
`isNull` seems missing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]