Fixed Disabling of VaultPropertySource #237
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📌 Description
Previously the installation of
VaultPropertySourcewas only conditional on theVaultTemplateclass being present, making it impossible to disable so long as it is on the classpath (disrupting tests, feature flags and other scenarios where it is not feasible/desirable to have a valid OCI Session)Aspects of the problem (all addressed in this PR):
spring.cloud.oci.vault.enabledpropspring.cloud.oci.vault.property-sourcespropApplicationContextRunner-style tests are intentionally stripped of many Spring Boot default behaviours, which must be re-introduced as appropriate)While I was in the tests, I noticed that there were no tests for the happy path of
VaultPropertySourceeither, so I went ahead and added one. This is isolated to its own commit (for your reviewing pleasure), but may be squashed or split into a separate PR if desired.✅ Checklist
📸 Logs
Error # 1
(when setting
spring.cloud.oci.vault.enabled: falseand supplying no auth config)Error # 2
(when supplying valid auth config, yet choosing not to set the
spring.cloud.oci.vault.property-sourcesprop)