Skip to content

Commit

Permalink
verify PrimaryKey equals (#12574)
Browse files Browse the repository at this point in the history
  • Loading branch information
sullis authored Mar 6, 2024
1 parent 227281a commit 5282942
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/**
* The primary key of a record. Note that the value used in the primary key must be single-value.
*/
public class PrimaryKey {
public final class PrimaryKey {
private final Object[] _values;

public PrimaryKey(Object[] values) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.math.BigDecimal;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import nl.jqno.equalsverifier.EqualsVerifier;
import org.apache.pinot.spi.utils.BigDecimalUtils;
import org.apache.pinot.spi.utils.ByteArray;
import org.testng.annotations.Test;
Expand All @@ -43,6 +44,11 @@ public void testPrimaryKeyComparison() {
assertNotEquals(left.hashCode(), right.hashCode());
}

@Test
public void equalsVerifier() {
EqualsVerifier.forClass(PrimaryKey.class).verify();
}

@Test
public void testSerialization() {
byte[] rawbytes = {0xa, 0x2, (byte) 0xff};
Expand Down

0 comments on commit 5282942

Please sign in to comment.