Skip to content

Commit

Permalink
Fix the capitalization of property for `S3EncryptionConditional.KmsKe…
Browse files Browse the repository at this point in the history
…yProperty` (#1337)

Fixes #1333 

---------

Co-authored-by: Giacomo Baso <[email protected]>
  • Loading branch information
gbaso and gbaso authored Feb 4, 2025
1 parent 265a955 commit e30abe3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2024 the original author or authors.
* Copyright 2013-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,6 +23,7 @@
* Conditional for creating {@link software.amazon.encryption.s3.S3EncryptionClient}. Will only create
* S3EncryptionClient if one of following is true.
* @author Matej Nedic
* @author Giacomo Baso
* @since 3.3.0
*/
public class S3EncryptionConditional extends AnyNestedCondition {
Expand All @@ -38,7 +39,7 @@ static class RSAProviderCondition {
static class AESProviderCondition {
}

@ConditionalOnProperty(name = "spring.cloud.aws.s3.encryption.keyId")
@ConditionalOnProperty(name = "spring.cloud.aws.s3.encryption.key-id")
static class KmsKeyProperty {
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2022 the original author or authors.
* Copyright 2013-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -66,6 +66,7 @@
*
* @author Maciej Walkowiak
* @author Matej Nedic
* @author Giacomo Baso
*/
class S3AutoConfigurationTests {

Expand Down Expand Up @@ -138,7 +139,7 @@ class S3ClientTests {
@Test
void s3ClientCanBeOverwritten() {
contextRunnerEncryption
.withPropertyValues("spring.cloud.aws.s3.encryption.keyId:234abcd-12ab-34cd-56ef-1234567890ab")
.withPropertyValues("spring.cloud.aws.s3.encryption.key-id:234abcd-12ab-34cd-56ef-1234567890ab")
.withUserConfiguration(CustomS3ClientConfiguration.class).run(context -> {
assertThat(context).hasSingleBean(S3Client.class);
});
Expand Down Expand Up @@ -167,6 +168,15 @@ void createsEncryptionClientBackedByAes() {
assertThat(context).hasSingleBean(S3AesProvider.class);
});
}

@Test
void createsEncryptionClientBackedByKms() {
contextRunnerEncryption
.withPropertyValues("spring.cloud.aws.s3.encryption.key-id:234abcd-12ab-34cd-56ef-1234567890ab")
.run(context -> {
assertThat(context).hasSingleBean(S3EncryptionClient.class);
});
}
}

@Nested
Expand Down

0 comments on commit e30abe3

Please sign in to comment.