nastra commented on code in PR #11577:
URL: https://github.com/apache/iceberg/pull/11577#discussion_r1991000079
##########
azure/src/test/java/org/apache/iceberg/azure/AzurePropertiesTest.java:
##########
@@ -71,6 +78,49 @@ public void testWithSasToken() {
verify(clientBuilder,
never()).credential(any(StorageSharedKeyCredential.class));
}
+ @Test
+ public void testWithRefreshCredentialsEndpoint() {
+ try (var providerMockedConstruction =
mockConstruction(VendedAdlsCredentialProvider.class);
+ var policyMockedConstruction =
mockConstruction(VendedAzureSasCredentialPolicy.class)) {
+ AzureProperties props =
+ new
AzureProperties(ImmutableMap.of(ADLS_REFRESH_CREDENTIALS_ENDPOINT, "endpoint"));
+ assertThat(providerMockedConstruction.constructed()).hasSize(1);
+ var providerMock = providerMockedConstruction.constructed().get(0);
+ String sasToken = "random-token";
+
+ when(providerMock.credentialForAccount("account1")).thenReturn(sasToken);
+ DataLakeFileSystemClientBuilder clientBuilder =
mock(DataLakeFileSystemClientBuilder.class);
+ props.applyClientConfiguration("account1", clientBuilder);
+
+ var policyMock = policyMockedConstruction.constructed().get(0);
Review Comment:
instead of using `var` I think it's better to define the actual type here
and everywhere else
--
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]