Skip to content

Commit

Permalink
Simplify size asserts in TestGlueToTrinoConverter
Browse files Browse the repository at this point in the history
  • Loading branch information
nineinchnick authored and ebyhr committed Oct 31, 2024
1 parent d800127 commit 6763e98
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void testConvertTableWithOpenCSVSerDe()
assertThat(trinoTable.getTableType()).isEqualTo(getTableTypeNullable(glueTable));
assertThat(trinoTable.getOwner().orElse(null)).isEqualTo(glueTable.getOwner());
assertThat(trinoTable.getParameters()).isEqualTo(getTableParameters(glueTable));
assertThat(trinoTable.getDataColumns().size()).isEqualTo(1);
assertThat(trinoTable.getDataColumns()).hasSize(1);
assertThat(trinoTable.getDataColumns().get(0).getType()).isEqualTo(HIVE_STRING);

assertColumnList(trinoTable.getPartitionColumns(), glueTable.getPartitionKeys());
Expand Down Expand Up @@ -223,7 +223,7 @@ public void testIcebergTableNullStorageDescriptor()
testTable.setParameters(ImmutableMap.of(ICEBERG_TABLE_TYPE_NAME, ICEBERG_TABLE_TYPE_VALUE));
testTable.setStorageDescriptor(null);
io.trino.metastore.Table trinoTable = GlueToTrinoConverter.convertTable(testTable, testDatabase.getName());
assertThat(trinoTable.getDataColumns().size()).isEqualTo(1);
assertThat(trinoTable.getDataColumns()).hasSize(1);
}

@Test
Expand All @@ -232,7 +232,7 @@ public void testIcebergTableNonNullStorageDescriptor()
testTable.setParameters(ImmutableMap.of(ICEBERG_TABLE_TYPE_NAME, ICEBERG_TABLE_TYPE_VALUE));
assertThat(getStorageDescriptor(testTable)).isPresent();
io.trino.metastore.Table trinoTable = GlueToTrinoConverter.convertTable(testTable, testDatabase.getName());
assertThat(trinoTable.getDataColumns().size()).isEqualTo(1);
assertThat(trinoTable.getDataColumns()).hasSize(1);
}

@Test
Expand All @@ -241,7 +241,7 @@ public void testDeltaTableNullStorageDescriptor()
testTable.setParameters(ImmutableMap.of(SPARK_TABLE_PROVIDER_KEY, DELTA_LAKE_PROVIDER));
testTable.setStorageDescriptor(null);
io.trino.metastore.Table trinoTable = GlueToTrinoConverter.convertTable(testTable, testDatabase.getName());
assertThat(trinoTable.getDataColumns().size()).isEqualTo(1);
assertThat(trinoTable.getDataColumns()).hasSize(1);
}

@Test
Expand All @@ -259,7 +259,7 @@ public void testIcebergMaterializedViewNullStorageDescriptor()
Table testMaterializedView = getGlueTestTrinoMaterializedView(testDatabase.getName());
assertThat(getStorageDescriptor(testMaterializedView)).isEmpty();
io.trino.metastore.Table trinoTable = GlueToTrinoConverter.convertTable(testMaterializedView, testDatabase.getName());
assertThat(trinoTable.getDataColumns().size()).isEqualTo(1);
assertThat(trinoTable.getDataColumns()).hasSize(1);
}

@Test
Expand All @@ -274,7 +274,7 @@ private static void assertColumnList(List<Column> actual, List<com.amazonaws.ser
if (expected == null) {
assertThat(actual).isNull();
}
assertThat(actual.size()).isEqualTo(expected.size());
assertThat(actual).hasSize(expected.size());

for (int i = 0; i < expected.size(); i++) {
assertColumn(actual.get(i), expected.get(i));
Expand Down

0 comments on commit 6763e98

Please sign in to comment.