tkalkirill commented on code in PR #1652:
URL: https://github.com/apache/ignite-3/pull/1652#discussion_r1105533296


##########
modules/page-memory/src/integrationTest/java/org/apache/ignite/internal/pagememory/tree/AbstractBplusTreePageMemoryTest.java:
##########
@@ -2367,6 +2372,138 @@ void testFindNext() throws Exception {
         assertEquals(0L, tree.findNext(-1L, true));
     }
 
+    @Test
+    void testFindOneWithMapper() throws Exception {
+        TestTree tree = createTestTree(true);
+
+        tree.put(0L);
+
+        assertEquals("row0", tree.findOne(0L, row -> "row" + row));
+        assertEquals("rownull", tree.findOne(1L, row -> "row" + row));
+    }
+
+    @Test
+    void testFindWithMapper() throws Exception {
+        TestTree tree = createTestTree(true);
+
+        tree.put(0L);
+        tree.put(1L);
+
+        PeekTreeRowCursor<Long, String> cursor = tree.find(null, null, row -> 
"row" + row);
+
+        assertNull(cursor.peek());
+
+        assertTrue(cursor.hasNext());
+        assertEquals(0L, cursor.peek());
+        assertEquals("row0", cursor.next());
+
+        assertTrue(cursor.hasNext());
+        assertEquals(1L, cursor.peek());
+        assertEquals("row1", cursor.next());
+
+        assertFalse(cursor.hasNext());
+        assertNull(cursor.peek());
+        assertThrows(NoSuchElementException.class, cursor::next);
+    }
+
+    @Test
+    void testInvokeClosureWithOnUpdateCallbackForPut() throws Exception {
+        TestTree tree = createTestTree(true);
+
+        // Checks insert.
+        CompletableFuture<Void> future0 = new CompletableFuture<>();

Review Comment:
   I'll use mokito, thanks!



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to