rdblue commented on code in PR #18884:
URL: https://github.com/apache/iceberg/pull/18884#discussion_r4569411829
##########
core/src/test/java/org/apache/iceberg/TestTrackedFileAdapters.java:
##########
@@ -265,6 +267,32 @@ void dataFileAdapterRejectsNonDataContent(FileContent
contentType) {
.hasMessage("Invalid content type for DataFile: %s", contentType);
}
+ @Test
+ void dataFileAdapterRejectsColumnFiles() {
Review Comment:
This can be much shorter using a mock like similar tests already do:
```java
@Test
void dataFileRejectsColumnFiles() {
TrackedFile trackedDataFile = mock(TrackedFile.class);
when(trackedDataFile.contentType()).thenReturn(FileContent.DATA);
when(trackedDataFile.columnFiles())
.thenReturn(ImmutableList.of(Mockito.mock(ColumnFile.class)));
when(trackedDataFile.location()).thenReturn("s3://bucket/path/file.parquet");
assertThatThrownBy(() -> TrackedFileAdapters.asDataFile(trackedDataFile,
UNPARTITIONED))
.isInstanceOf(UnsupportedOperationException.class)
.hasMessage(
"Cannot convert data file with column updates: %s",
"s3://bucket/path/file.parquet");
}
```
--
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]