dimas-b commented on code in PR #3210:
URL: https://github.com/apache/polaris/pull/3210#discussion_r2593066935


##########
runtime/service/src/test/java/org/apache/polaris/service/admin/PolarisAuthzTestBase.java:
##########
@@ -231,13 +232,9 @@ public void before(TestInfo testInfo) {
 
     RealmContext realmContext = testInfo::getDisplayName;
     QuarkusMock.installMockForType(realmContext, RealmContext.class);
+    realmContextHolder.set(realmContext);
     polarisContext = callContext.getPolarisCallContext();
 
-    ContainerRequestContext containerRequestContext = 
Mockito.mock(ContainerRequestContext.class);

Review Comment:
   In this PR `ContainerRequestContext` is not longer a CDI bean required by 
Polaris (see changes in `ServiceProducers`). Therefore, CDI mocks cannot 
actually be installed for it (test time exception).
   
   In general, this particular test class does not validate request ID 
handling, so mocking request IDs is not actually necessary in this class.
   
   Moreover, the 
`Mockito.when(containerRequestContext.getProperty(Mockito.anyString())).thenReturn("request-id-1")`
 mock was not specific to request IDs (note `anyString`) and in this particular 
case was likely mocking Realm IDs, which is handled on line 235 now.



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