Skip to content

Commit 123d40c

Browse files
authored
Fix no-op assertion in ContentIdentifier index-key round-trip test (apache#4979)
The storageLocation test builds identifierFromKey via indexKeyToIdentifier(identifier.toIndexKey()) to check the IndexKey round-trip, but asserts identifierFromKey isEqualTo identifierFromKey, comparing the value to itself. That is vacuously true and never verifies the toIndexKey / indexKeyToIdentifier serialization, so a regression there would go undetected. Assert against the original identifier so the test actually covers the round-trip. The corrected assertion passes for all parameterized inputs.
1 parent 3dd26bc commit 123d40c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

persistence/nosql/persistence/metastore/src/test/java/org/apache/polaris/persistence/nosql/metastore/TestContentIdentifier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void storageLocation(String input, List<String> elements) {
4242
soft.assertThat(identifier.elements()).containsExactlyElementsOf(elements);
4343
var inKey = identifier.toIndexKey();
4444
var identifierFromKey = ContentIdentifier.indexKeyToIdentifier(inKey);
45-
soft.assertThat(identifierFromKey).isEqualTo(identifierFromKey);
45+
soft.assertThat(identifierFromKey).isEqualTo(identifier);
4646
}
4747

4848
static Stream<Arguments> storageLocation() {

0 commit comments

Comments
 (0)