Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-tzhang committed Feb 23, 2024
1 parent 11fc5a3 commit c77b976
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
/**
* Interface to provide a custom offset verification logic. If specified, verification failures will
* be logged as warnings and reported to Snowflake. This interface could be used when there are
* certain assumption about the offset token behavior and please reach out to Snowflake if you
* notice any unexpected behaviors.
* certain assumption about the offset token behavior. Please reach out to Snowflake if you notice
* any unexpected behaviors.
*
* <p>Below is an example that verifies that all offset tokens are monotonically increasing numbers:
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,17 @@ public void testInsertRowsWithInvalidStartOffsetToken() throws Exception {
Assert.fail("Row sequencer not updated before timeout");
}

@Test
public void testOffsetTokenVerificationFunction() {
Assert.assertTrue(offsetTokenVerificationFunction.verify("1", "2", "4", 3));
Assert.assertTrue(offsetTokenVerificationFunction.verify(null, "2", "4", 3));
Assert.assertTrue(offsetTokenVerificationFunction.verify("1", "2", null, 3));
Assert.assertTrue(offsetTokenVerificationFunction.verify("a", "2", "4", 3));
Assert.assertFalse(offsetTokenVerificationFunction.verify("1", "3", "4", 3));
Assert.assertFalse(offsetTokenVerificationFunction.verify("2", "1", "4", 3));
Assert.assertFalse(offsetTokenVerificationFunction.verify("1", "2", "4", 2));
}

@Test
public void testChannelClose() throws Exception {
OpenChannelRequest request1 =
Expand Down

0 comments on commit c77b976

Please sign in to comment.