Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ public GrantResources listGrants(String catalogName, String catalogRoleName) {

public void createCatalog(String principalRoleName, Catalog catalog) {
createCatalog(catalog);
makeAdmin(principalRoleName, catalog);
}

public void makeAdmin(String principalRoleName, Catalog catalog) {
// Create a new CatalogRole that has CATALOG_MANAGE_CONTENT and CATALOG_MANAGE_ACCESS
String catalogRoleName = "custom-admin";
createCatalogRole(catalog.getName(), catalogRoleName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ public void before(TestInfo testInfo) {
.setStorageConfigInfo(storageConfig)
.build();

managementApi.createCatalog(principalRoleName, catalog);
createPolarisCatalog(catalog);
managementApi.makeAdmin(principalRoleName, catalog);

restCatalogConfig =
IntegrationTestsHelper.mergeFromAnnotatedElements(
Expand Down Expand Up @@ -340,6 +341,11 @@ protected RESTCatalog catalog() {
return restCatalog;
}

/** Overridable methods to allow subclasses to execute additional logic on catalog creation. */
protected void createPolarisCatalog(Catalog catalog) {
managementApi.createCatalog(catalog);
}

/**
* Initialize a RESTCatalog for testing.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ public void before(TestInfo testInfo) {
.setProperties(props)
.setStorageConfigInfo(storageConfig)
.build();
managementApi.createCatalog(principalRoleName, catalog);

createPolarisCatalog(catalog);
managementApi.makeAdmin(principalRoleName, catalog);

restCatalog =
IcebergHelper.restCatalog(
Expand All @@ -152,6 +154,11 @@ public void cleanUp() {
client.cleanUp(adminToken);
}

/** Overridable methods to allow subclasses to execute additional logic on catalog creation. */
protected void createPolarisCatalog(Catalog catalog) {
managementApi.createCatalog(catalog);
}

/**
* @return The catalog's storage config.
*/
Expand Down