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


##########
modules/table/src/test/java/org/apache/ignite/internal/table/distributed/raft/snapshot/PartitionAccessImplTest.java:
##########
@@ -119,4 +128,56 @@ void 
testMinMaxLastAppliedTerm(@InjectConfiguration("mock.tables.foo {}") Tables
         assertEquals(15, partitionAccess.minLastAppliedTerm());
         assertEquals(20, partitionAccess.maxLastAppliedTerm());
     }
+
+    @Test
+    void testAddWrite() {
+        TestMvTableStorage mvTableStorage = new 
TestMvTableStorage(tablesConfig.tables().get("foo"), tablesConfig);
+
+        MvPartitionStorage mvPartitionStorage = 
mvTableStorage.getOrCreateMvPartition(TEST_PARTITION_ID);
+
+        TableSchemaAwareIndexStorage indexStorage = 
mock(TableSchemaAwareIndexStorage.class);
+
+        PartitionAccess partitionAccess = new PartitionAccessImpl(
+                new PartitionKey(UUID.randomUUID(), TEST_PARTITION_ID),
+                mvTableStorage,
+                new TestTxStateTableStorage(),
+                () -> List.of(indexStorage)
+        );
+
+        RowId rowId = new RowId(TEST_PARTITION_ID);
+        TableRow tableRow = mock(TableRow.class);
+        UUID txId = UUID.randomUUID();
+        UUID commitTableId = UUID.randomUUID();
+
+        partitionAccess.addWrite(rowId, tableRow, txId, commitTableId, 
TEST_PARTITION_ID);
+
+        verify(mvPartitionStorage, times(1)).addWrite(eq(rowId), eq(tableRow), 
eq(txId), eq(commitTableId), eq(TEST_PARTITION_ID));

Review Comment:
   Thanks for the tip =), I'll leave it as it is.



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to