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


##########
modules/catalog/src/test/java/org/apache/ignite/internal/catalog/commands/CatalogUtilsTest.java:
##########
@@ -189,6 +217,187 @@ void testFromParamsAndPreviousValueWithAutoAdjustFields() 
{
         );
     }
 
+    @Test
+    void testCollectIndexesAfterCreateTable() throws Exception {
+        withCatalogManager(catalogManager -> {
+            createTable(catalogManager, TABLE_NAME);
+
+            int latestCatalogVersion = catalogManager.latestCatalogVersion();
+            int earliestCatalogVersion = 
catalogManager.earliestCatalogVersion();
+
+            int tableId = tableId(catalogManager, latestCatalogVersion, 
TABLE_NAME);
+
+            assertThat(
+                    collectIndexes(catalogManager, tableId, 
latestCatalogVersion, latestCatalogVersion),
+                    contains(index(catalogManager, latestCatalogVersion, 
PK_INDEX_NAME))
+            );
+
+            assertThat(
+                    collectIndexes(catalogManager, tableId, 
earliestCatalogVersion, latestCatalogVersion),
+                    contains(index(catalogManager, latestCatalogVersion, 
PK_INDEX_NAME))
+            );
+        });
+    }
+
+    @Test
+    void testCollectIndexesAfterCreateIndex() throws Exception {
+        withCatalogManager(catalogManager -> {
+            createTable(catalogManager, TABLE_NAME);
+            createIndex(catalogManager, TABLE_NAME, INDEX_NAME);
+
+            int latestCatalogVersion = catalogManager.latestCatalogVersion();
+            int earliestCatalogVersion = 
catalogManager.earliestCatalogVersion();
+
+            int tableId = tableId(catalogManager, latestCatalogVersion, 
TABLE_NAME);
+
+            assertThat(
+                    collectIndexes(catalogManager, tableId, 
latestCatalogVersion, latestCatalogVersion),
+                    contains(
+                            index(catalogManager, latestCatalogVersion, 
PK_INDEX_NAME),
+                            index(catalogManager, latestCatalogVersion, 
INDEX_NAME)
+                    )
+            );
+
+            assertThat(
+                    collectIndexes(catalogManager, tableId, 
earliestCatalogVersion, latestCatalogVersion),
+                    contains(
+                            index(catalogManager, latestCatalogVersion, 
PK_INDEX_NAME),
+                            index(catalogManager, latestCatalogVersion, 
INDEX_NAME)
+                    )
+            );
+        });
+    }
+
+    @Test
+    void testCollectIndexesAfterCreateIndexAndMakeAvailableIndex() throws 
Exception {
+        withCatalogManager(catalogManager -> {
+            String indexName0 = INDEX_NAME + 0;
+            String indexName1 = INDEX_NAME + 1;
+
+            createTable(catalogManager, TABLE_NAME);
+            createIndex(catalogManager, TABLE_NAME, indexName0);
+            createIndex(catalogManager, TABLE_NAME, indexName1);
+
+            makeIndexAvailable(catalogManager, indexName1);

Review Comment:
   Checks that the method will return both available and registered indexes.



-- 
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