XJDKC commented on code in PR #15818:
URL: https://github.com/apache/iceberg/pull/15818#discussion_r3035266016
##########
aws/src/test/java/org/apache/iceberg/aws/TestRESTSigV4AuthSession.java:
##########
@@ -306,4 +309,44 @@ void close() {
session.close();
Mockito.verify(delegate).close();
}
+
+ @Test
+ void closeWithCloseableCredentialsProvider() throws Exception {
+ AuthSession delegate = Mockito.mock(AuthSession.class);
+ CloseableAwsCredentialsProvider credentialsProvider =
+ Mockito.mock(CloseableAwsCredentialsProvider.class);
+ AwsProperties properties = Mockito.mock(AwsProperties.class);
+ when(properties.restSigningRegion()).thenReturn(Region.US_WEST_2);
+ when(properties.restSigningName()).thenReturn("execute-api");
+ when(properties.restCredentialsProvider()).thenReturn(credentialsProvider);
+
+ RESTSigV4AuthSession session = new RESTSigV4AuthSession(signer, delegate,
properties);
+ session.close();
+
+ Mockito.verify(delegate).close();
+ Mockito.verify(credentialsProvider).close();
Review Comment:
Extracted the comment part as a separate method!
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]