Skip to content

Commit

Permalink
Add test for the partitionKey with other operation
Browse files Browse the repository at this point in the history
  • Loading branch information
zymap committed May 23, 2024
1 parent cdfb4d8 commit 0e42e81
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import static io.streamnative.oxia.client.api.PutOption.IfRecordDoesNotExist;
import static io.streamnative.oxia.client.api.PutOption.IfVersionIdEquals;
import static io.streamnative.oxia.client.api.PutOption.PartitionKey;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.concurrent.CompletableFuture.allOf;
import static java.util.function.Function.identity;
Expand Down Expand Up @@ -229,6 +230,29 @@ void test() throws Exception {
.isEqualTo(24);
}

@Test
public void testGetFloorCeilingWithPartitionKey() throws Exception {
@Cleanup
SyncOxiaClient client = OxiaClientBuilder.create(oxia.getServiceAddress()).syncClient();


GetResult gr = client.get("a", Set.of(GetOption.PartitionKey("a"), GetOption.ComparisonCeiling));
if (gr != null) {
System.out.println(gr.getKey());
} else {
System.out.println("ComparisionCeiling null");
}


gr = client.get("a", Set.of(GetOption.PartitionKey("a"), GetOption.ComparisonHigher));
if (gr != null) {
System.out.println(gr.getKey());
} else {
System.out.println("ComparisionHigher null");
}

}

@Test
void testGetFloorCeiling() throws Exception {
@Cleanup
Expand Down

0 comments on commit 0e42e81

Please sign in to comment.