Samrat002 commented on code in PR #27788:
URL: https://github.com/apache/flink/pull/27788#discussion_r3249059082
##########
flink-filesystems/flink-s3-fs-native/src/test/java/org/apache/flink/fs/s3native/NativeS3FileSystemFactoryTest.java:
##########
@@ -378,4 +379,78 @@ void testS3AInheritsS3Configuration() throws Exception {
assertThat(fs.getClientProvider().isChunkedEncoding()).isFalse();
assertThat(fs.getClientProvider().isChecksumValidation()).isFalse();
}
+
+ // ---- Bucket-level configuration tests ----
+
+ /**
+ * Validates that misconfigured per-bucket credentials surface as a
configuration error at
+ * {@code configure()} time, not as an opaque AWS SDK error at first
request. Override
+ * resolution itself (which wins between bucket and global) is
exhaustively covered by {@code
+ * BucketConfigProviderTest}; this test guards the factory-layer behaviour
that is unique to it:
+ * throwing on partial bucket credentials.
+ */
+ @Test
+ void testBucketSpecificPartialCredentialsThrows() {
+ NativeS3FileSystemFactory factory = new NativeS3FileSystemFactory();
+ Configuration config = new Configuration();
+ config.setString("s3.access-key", "global-access-key");
+ config.setString("s3.secret-key", "global-secret-key");
+ config.setString("s3.region", "us-east-1");
+ config.setString("s3.bucket.bad-bucket.access-key", "only-access-key");
+ config.setString("io.tmp.dirs", System.getProperty("java.io.tmpdir"));
+
+ assertThatThrownBy(() -> factory.configure(config))
+ .isInstanceOf(IllegalConfigurationException.class)
+ .hasMessageContaining("must be set together");
+ }
+
+ @Test
+ void testBucketOverrideAppliedForMatchingBucket() throws Exception {
Review Comment:
added
--
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]