Fix PolarisAdminServiceTest - #5637
Merged
Merged
Conversation
Fix NPE on `AttributeMap` in `testRotateCredentialsConcurrentModificationThrowsCommitConflictException()` caused by overlapped merges of apache#5504 and apache#5119
ayushtkn
approved these changes
Sep 28, 2026
Member
There was a problem hiding this comment.
LGTM. Even I was fixing this, the error showed on my commit on main, I thought I broke it 😅
Thanx @dimas-b for the quick fix 😀
I tried it this way
diff --git a/runtime/service/src/test/java/org/apache/polaris/service/admin/PolarisAdminServiceTest.java b/runtime/service/src/test/java/org/apache/polaris/service/admin/PolarisAdminServiceTest.java
index 427420af78..a5b3aa1bd7 100644
--- a/runtime/service/src/test/java/org/apache/polaris/service/admin/PolarisAdminServiceTest.java
+++ b/runtime/service/src/test/java/org/apache/polaris/service/admin/PolarisAdminServiceTest.java
@@ -55,6 +55,7 @@ import org.apache.polaris.core.auth.AuthorizationState;
import org.apache.polaris.core.auth.PolarisAuthorizer;
import org.apache.polaris.core.auth.PolarisPrincipal;
import org.apache.polaris.core.catalog.PolarisCatalogHelpers;
+import org.apache.polaris.core.collection.ImmutableAttributeMap;
import org.apache.polaris.core.config.BehaviorChangeConfiguration;
import org.apache.polaris.core.config.FeatureConfiguration;
import org.apache.polaris.core.config.RealmConfig;
@@ -1086,6 +1087,8 @@ public class PolarisAdminServiceTest {
when(resolutionManifest.getResolvedTopLevelEntity(
eq(principalName), eq(PolarisEntityType.PRINCIPAL)))
.thenReturn(wrapper);
+ when(authenticatedPrincipal.getAttributes())
+ .thenReturn(ImmutableAttributeMap.builder().build());
PolarisPrincipalSecrets currentSecrets =
new PolarisPrincipalSecrets(100L, "test_client", "main_secret");
Contributor
Author
|
@ayushtkn : yeah, I thought about mocking, but given that |
dimas-b
enabled auto-merge (squash)
September 28, 2026 18:24
flyrain
approved these changes
Sep 28, 2026
vigneshio
approved these changes
Sep 28, 2026
adutra
approved these changes
Sep 28, 2026
nandorKollar
approved these changes
Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix NPE on
AttributeMapintestRotateCredentialsConcurrentModificationThrowsCommitConflictException()caused by overlapped merges of #5504 and #5119Checklist
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed)