nastra commented on code in PR #9068: URL: https://github.com/apache/iceberg/pull/9068#discussion_r1393807167
########## azure/src/test/java/org/apache/iceberg/azure/AzurePropertiesTest.java: ########## @@ -90,4 +93,34 @@ public void testNoConnectionString() { props.applyClientConfiguration("account", clientBuilder); verify(clientBuilder).endpoint("https://account"); } + + @Test + public void testSharedKe() { + Assertions.assertThatIllegalStateException() + .isThrownBy( + () -> + new AzureProperties( + ImmutableMap.of( + ADLS_SHARED_KEY_ACCOUNT_KEY, "not-really-base64-encoded-key-here"))) + .withMessage( + String.format( + "Azure authentication: shared-key requires both %s and %s", + ADLS_SHARED_KEY_ACCOUNT_NAME, ADLS_SHARED_KEY_ACCOUNT_KEY)); + Assertions.assertThatIllegalStateException() + .isThrownBy( + () -> new AzureProperties(ImmutableMap.of(ADLS_SHARED_KEY_ACCOUNT_NAME, "account"))) + .withMessage( + String.format( + "Azure authentication: shared-key requires both %s and %s", + ADLS_SHARED_KEY_ACCOUNT_NAME, ADLS_SHARED_KEY_ACCOUNT_KEY)); + Assertions.assertThatNoException() Review Comment: rather than checking that no exception has been thrown, it would be better to make sure that the right credentials have been configured (similar to how other tests in this class do it): `verify(clientBuilder).credential(...)` ########## azure/src/test/java/org/apache/iceberg/azure/AzurePropertiesTest.java: ########## @@ -90,4 +93,34 @@ public void testNoConnectionString() { props.applyClientConfiguration("account", clientBuilder); verify(clientBuilder).endpoint("https://account"); } + + @Test + public void testSharedKe() { Review Comment: typo ########## azure/src/test/java/org/apache/iceberg/azure/AzurePropertiesTest.java: ########## @@ -90,4 +93,34 @@ public void testNoConnectionString() { props.applyClientConfiguration("account", clientBuilder); verify(clientBuilder).endpoint("https://account"); } + + @Test + public void testSharedKe() { Review Comment: typo -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org