You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "nastra (via GitHub)" <gi...@apache.org> on 2024/03/19 17:06:01 UTC
Re: [PR] Migrate Transactions, Partitions and Statistics files in Core to JUnit5 [iceberg]
nastra commented on code in PR #9999:
URL: https://github.com/apache/iceberg/pull/9999#discussion_r1530770150
##########
core/src/test/java/org/apache/iceberg/TestPartitionSpecInfo.java:
##########
@@ -68,38 +66,38 @@ public void testSpecIsUnpartitionedForVoidTranforms() {
PartitionSpec spec =
PartitionSpec.builderFor(schema).alwaysNull("id").alwaysNull("data").build();
- Assert.assertTrue(spec.isUnpartitioned());
+ assertThat(spec.isUnpartitioned()).isTrue();
}
@Test
public void testSpecInfoUnpartitionedTable() {
PartitionSpec spec = PartitionSpec.unpartitioned();
TestTables.TestTable table = TestTables.create(tableDir, "test", schema, spec, formatVersion);
- Assert.assertTrue(spec.isUnpartitioned());
- Assert.assertEquals(spec, table.spec());
- Assert.assertEquals(spec.lastAssignedFieldId(), table.spec().lastAssignedFieldId());
- Assert.assertEquals(ImmutableMap.of(spec.specId(), spec), table.specs());
- Assert.assertNull(table.specs().get(Integer.MAX_VALUE));
+ assertThat(spec.isUnpartitioned()).isTrue();
+ assertThat(table.spec()).isEqualTo(spec);
+ assertThat(table.spec().lastAssignedFieldId()).isEqualTo(spec.lastAssignedFieldId());
+ assertThat(table.specs()).containsEntry(spec.specId(), spec);
Review Comment:
this should do `isEqualTo()` as in the previous version of the code
##########
core/src/test/java/org/apache/iceberg/TestPartitionSpecInfo.java:
##########
@@ -68,38 +66,38 @@ public void testSpecIsUnpartitionedForVoidTranforms() {
PartitionSpec spec =
PartitionSpec.builderFor(schema).alwaysNull("id").alwaysNull("data").build();
- Assert.assertTrue(spec.isUnpartitioned());
+ assertThat(spec.isUnpartitioned()).isTrue();
}
@Test
public void testSpecInfoUnpartitionedTable() {
PartitionSpec spec = PartitionSpec.unpartitioned();
TestTables.TestTable table = TestTables.create(tableDir, "test", schema, spec, formatVersion);
- Assert.assertTrue(spec.isUnpartitioned());
- Assert.assertEquals(spec, table.spec());
- Assert.assertEquals(spec.lastAssignedFieldId(), table.spec().lastAssignedFieldId());
- Assert.assertEquals(ImmutableMap.of(spec.specId(), spec), table.specs());
- Assert.assertNull(table.specs().get(Integer.MAX_VALUE));
+ assertThat(spec.isUnpartitioned()).isTrue();
+ assertThat(table.spec()).isEqualTo(spec);
+ assertThat(table.spec().lastAssignedFieldId()).isEqualTo(spec.lastAssignedFieldId());
+ assertThat(table.specs()).containsEntry(spec.specId(), spec);
+ assertThat(table.specs().get(Integer.MAX_VALUE)).isNull();
Review Comment:
`doesNotContainEntry()`
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org