singhpk234 commented on code in PR #2670:
URL: https://github.com/apache/polaris/pull/2670#discussion_r2377263382
##########
runtime/service/src/test/java/org/apache/polaris/service/auth/AuthenticatingAugmentorTest.java:
##########
@@ -92,6 +93,29 @@ public void testAugmentAuthenticationFailure() {
.hasCause(exception);
}
+ @Test
+ public void testServiceFailureExceptionBubblesUp() {
+ // Given
+ Principal nonPolarisPrincipal = mock(Principal.class);
+ PolarisCredential credential = mock(PolarisCredential.class);
+ SecurityIdentity identity =
+ QuarkusSecurityIdentity.builder()
+ .setPrincipal(nonPolarisPrincipal)
+ .addCredential(credential)
+ .build();
+
+ ServiceFailureException serviceException =
+ new ServiceFailureException("Unable to fetch principal entity");
+ when(authenticator.authenticate(credential)).thenThrow(serviceException);
+
+ // When/Then
+ assertThatThrownBy(
+ () -> augmentor.augment(identity,
Uni.createFrom()::item).await().indefinitely())
+ .isInstanceOf(ServiceFailureException.class)
+ .hasMessage("Unable to fetch principal entity")
+ .isNotInstanceOf(AuthenticationFailedException.class);
Review Comment:
is this check required ?
--
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]