adutra commented on PR #3780:
URL: https://github.com/apache/polaris/pull/3780#issuecomment-3907928459

   The current test infrastructure contains several overloaded methods, now 
grouped in `PolarisAuthzTestBase`.
   
   I am planning to further refactor those methods into a fluent assertion 
builder, e.g. instead of:
   
   ```java
       return doTestSufficientPrivilegeSets(
           "createTableDirectWithWriteDelegation",
           List.of(
               Set.of(PolarisPrivilege.TABLE_CREATE, 
PolarisPrivilege.TABLE_WRITE_DATA),
               Set.of(PolarisPrivilege.CATALOG_MANAGE_CONTENT)),
           () -> {
             newWrapper(Set.of(PRINCIPAL_ROLE1))
                 .createTableDirectWithWriteDelegation(
                     NS2, createDirectWithWriteDelegationRequest, 
Optional.empty());
           },
           () -> {
             newWrapper(Set.of(PRINCIPAL_ROLE2)).dropTableWithPurge(newtable);
           },
           PRINCIPAL_NAME);
   ```
   We would have:
   
   ```java
       assertThatOperation("createTableDirectWithWriteDelegation")
           .withAction(
               () ->
                   newWrapper(Set.of(PRINCIPAL_ROLE1))
                       .createTableDirectWithWriteDelegation(
                           NS2, createDirectWithWriteDelegationRequest, 
Optional.empty()))
           .withCleanupAction(() -> 
newWrapper(Set.of(PRINCIPAL_ROLE2)).dropTableWithPurge(newtable))
           .withPrincipalName(PRINCIPAL_NAME)
           .succeedsWith(PolarisPrivilege.TABLE_CREATE, 
PolarisPrivilege.TABLE_WRITE_DATA)
           .succeedsWith(PolarisPrivilege.CATALOG_MANAGE_CONTENT);
   ```
   
   But I thought it would better to introduce the dynamic test refactoring 
first, without modifying the underlying infrastructure.


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