xtern commented on code in PR #3590:
URL: https://github.com/apache/ignite-3/pull/3590#discussion_r1562584401
##########
modules/catalog/src/test/java/org/apache/ignite/internal/catalog/CatalogManagerSelfTest.java:
##########
@@ -1351,9 +1354,50 @@ public void testCreateZone() {
assertEquals("test_profile",
zone.storageProfiles().profiles().get(0).storageProfile());
}
+ @Test
+ public void testSetDefaultZone() {
+ StorageProfileParams storageProfile = StorageProfileParams.builder()
+ .storageProfile("test_profile")
+ .build();
+
+ CatalogCommand createZoneCmd = CreateZoneCommand.builder()
+ .zoneName(TEST_ZONE_NAME)
+ .storageProfilesParams(List.of(storageProfile))
+ .build();
+
+ assertThat(manager.execute(createZoneCmd), willCompleteSuccessfully());
+
+ assertNotEquals(TEST_ZONE_NAME, defaultZone().name());
+
+ CatalogCommand setDefaultCmd =
AlterZoneSetDefaultCatalogCommand.builder()
+ .zoneName(TEST_ZONE_NAME)
+ .build();
+
+ assertThat(manager.execute(setDefaultCmd), willCompleteSuccessfully());
+ assertEquals(TEST_ZONE_NAME, defaultZone().name());
+
+ assertThat(manager.execute(simpleTable(TABLE_NAME)),
willCompleteSuccessfully());
+
+ Catalog catalog =
Objects.requireNonNull(manager.catalog(manager.latestCatalogVersion()));
+
+ CatalogTableDescriptor tab =
Objects.requireNonNull(manager.table(TABLE_NAME, catalog.time()));
+
+ assertEquals(defaultZone().id(), tab.zoneId());
+
+ // Setting default zone that is already the default changes nothing.
+ int lastVer = catalog.version();
Review Comment:
Done, 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]