Skip to content

Commit

Permalink
check style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
PradhanPrerak committed Jul 3, 2024
1 parent 4b26b50 commit 0fba78f
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ private Constants() {
/** Prefix for S3A client-specific properties. */
public static final String FS_S3A_CLIENT_PREFIX = "fs.s3a.client.";

/** Custom headers postfix */
/** Custom headers postfix. */
public static final String CUSTOM_HEADERS_POSTFIX = ".custom.headers";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,14 +424,14 @@ private static void initRequestHeaders(Configuration conf,
ClientOverrideConfiguration.Builder clientConfig, String awsServiceIdentifier) {
String configKey = null;
switch (awsServiceIdentifier) {
case AWS_SERVICE_IDENTIFIER_S3:
configKey = CUSTOM_HEADERS_S3;
break;
case AWS_SERVICE_IDENTIFIER_STS:
configKey = CUSTOM_HEADERS_STS;
break;
default:
// Nothing to do. The original signer override is already setup
case AWS_SERVICE_IDENTIFIER_S3:
configKey = CUSTOM_HEADERS_S3;
break;
case AWS_SERVICE_IDENTIFIER_STS:
configKey = CUSTOM_HEADERS_STS;
break;
default:
// Nothing to do. The original signer override is already setup
}
if (configKey != null) {
Map<String, String> awsClientCustomHeadersMap =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,18 +221,22 @@ public void testInitRequestHeadersForSTS() throws IOException {
.describedAs("Custom client headers for s3 %s", CUSTOM_HEADERS_S3)
.isNull();

Assertions.assertThat(createClientConfigBuilder(conf, AWS_SERVICE_IDENTIFIER_S3).headers().size())
.describedAs("Count of S3 client headers")
.isEqualTo(0);
Assertions.assertThat(createClientConfigBuilder(conf, AWS_SERVICE_IDENTIFIER_STS).headers().size())
.describedAs("Count of STS client headers")
.isEqualTo(2);
Assertions.assertThat(createClientConfigBuilder(conf, AWS_SERVICE_IDENTIFIER_STS).headers().get("foo"))
.describedAs("STS client 'foo' header value")
.isEqualTo(Lists.newArrayList("bar", "baz"));
Assertions.assertThat(createClientConfigBuilder(conf, AWS_SERVICE_IDENTIFIER_STS).headers().get("qux"))
.describedAs("STS client 'qux' header value")
.isEqualTo(Lists.newArrayList("quux"));
Assertions.assertThat(createClientConfigBuilder(conf, AWS_SERVICE_IDENTIFIER_S3)
.headers().size())
.describedAs("Count of S3 client headers")
.isEqualTo(0);
Assertions.assertThat(createClientConfigBuilder(conf, AWS_SERVICE_IDENTIFIER_STS)
.headers().size())
.describedAs("Count of STS client headers")
.isEqualTo(2);
Assertions.assertThat(createClientConfigBuilder(conf, AWS_SERVICE_IDENTIFIER_STS)
.headers().get("foo"))
.describedAs("STS client 'foo' header value")
.isEqualTo(Lists.newArrayList("bar", "baz"));
Assertions.assertThat(createClientConfigBuilder(conf, AWS_SERVICE_IDENTIFIER_STS)
.headers().get("qux"))
.describedAs("STS client 'qux' header value")
.isEqualTo(Lists.newArrayList("quux"));
}

/**
Expand All @@ -247,17 +251,21 @@ public void testInitRequestHeadersForS3() throws IOException {
.describedAs("Custom client headers for STS %s", CUSTOM_HEADERS_STS)
.isNull();

Assertions.assertThat(createClientConfigBuilder(conf, AWS_SERVICE_IDENTIFIER_STS).headers().size())
.describedAs("Count of STS client headers")
.isEqualTo(0);
Assertions.assertThat(createClientConfigBuilder(conf, AWS_SERVICE_IDENTIFIER_S3).headers().size())
.describedAs("Count of S3 client headers")
.isEqualTo(2);
Assertions.assertThat(createClientConfigBuilder(conf, AWS_SERVICE_IDENTIFIER_S3).headers().get("foo"))
.describedAs("S3 client 'foo' header value")
.isEqualTo(Lists.newArrayList("bar", "baz"));
Assertions.assertThat(createClientConfigBuilder(conf, AWS_SERVICE_IDENTIFIER_S3).headers().get("qux"))
.describedAs("S3 client 'qux' header value")
.isEqualTo(Lists.newArrayList("quux"));
Assertions.assertThat(createClientConfigBuilder(conf, AWS_SERVICE_IDENTIFIER_STS)
.headers().size())
.describedAs("Count of STS client headers")
.isEqualTo(0);
Assertions.assertThat(createClientConfigBuilder(conf, AWS_SERVICE_IDENTIFIER_S3)
.headers().size())
.describedAs("Count of S3 client headers")
.isEqualTo(2);
Assertions.assertThat(createClientConfigBuilder(conf, AWS_SERVICE_IDENTIFIER_S3)
.headers().get("foo"))
.describedAs("S3 client 'foo' header value")
.isEqualTo(Lists.newArrayList("bar", "baz"));
Assertions.assertThat(createClientConfigBuilder(conf, AWS_SERVICE_IDENTIFIER_S3)
.headers().get("qux"))
.describedAs("S3 client 'qux' header value")
.isEqualTo(Lists.newArrayList("quux"));
}
}

0 comments on commit 0fba78f

Please sign in to comment.