Skip to content

Commit e30abe3

Browse files
authored
Fix the capitalization of property for S3EncryptionConditional.KmsKeyProperty (#1337)
Fixes #1333 --------- Co-authored-by: Giacomo Baso <gbaso@users.noreply.github.com>
1 parent 265a955 commit e30abe3

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

spring-cloud-aws-autoconfigure/src/main/java/io/awspring/cloud/autoconfigure/s3/S3EncryptionConditional.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2024 the original author or authors.
2+
* Copyright 2013-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
2323
* Conditional for creating {@link software.amazon.encryption.s3.S3EncryptionClient}. Will only create
2424
* S3EncryptionClient if one of following is true.
2525
* @author Matej Nedic
26+
* @author Giacomo Baso
2627
* @since 3.3.0
2728
*/
2829
public class S3EncryptionConditional extends AnyNestedCondition {
@@ -38,7 +39,7 @@ static class RSAProviderCondition {
3839
static class AESProviderCondition {
3940
}
4041

41-
@ConditionalOnProperty(name = "spring.cloud.aws.s3.encryption.keyId")
42+
@ConditionalOnProperty(name = "spring.cloud.aws.s3.encryption.key-id")
4243
static class KmsKeyProperty {
4344
}
4445
}

spring-cloud-aws-autoconfigure/src/test/java/io/awspring/cloud/autoconfigure/s3/S3AutoConfigurationTests.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2022 the original author or authors.
2+
* Copyright 2013-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -66,6 +66,7 @@
6666
*
6767
* @author Maciej Walkowiak
6868
* @author Matej Nedic
69+
* @author Giacomo Baso
6970
*/
7071
class S3AutoConfigurationTests {
7172

@@ -138,7 +139,7 @@ class S3ClientTests {
138139
@Test
139140
void s3ClientCanBeOverwritten() {
140141
contextRunnerEncryption
141-
.withPropertyValues("spring.cloud.aws.s3.encryption.keyId:234abcd-12ab-34cd-56ef-1234567890ab")
142+
.withPropertyValues("spring.cloud.aws.s3.encryption.key-id:234abcd-12ab-34cd-56ef-1234567890ab")
142143
.withUserConfiguration(CustomS3ClientConfiguration.class).run(context -> {
143144
assertThat(context).hasSingleBean(S3Client.class);
144145
});
@@ -167,6 +168,15 @@ void createsEncryptionClientBackedByAes() {
167168
assertThat(context).hasSingleBean(S3AesProvider.class);
168169
});
169170
}
171+
172+
@Test
173+
void createsEncryptionClientBackedByKms() {
174+
contextRunnerEncryption
175+
.withPropertyValues("spring.cloud.aws.s3.encryption.key-id:234abcd-12ab-34cd-56ef-1234567890ab")
176+
.run(context -> {
177+
assertThat(context).hasSingleBean(S3EncryptionClient.class);
178+
});
179+
}
170180
}
171181

172182
@Nested

0 commit comments

Comments
 (0)