spring-cloud / spring-cloud/spring-cloud-consul

spring.config.import in DynamicPropertySource is not contributed using ConfigDataApplicationContextInitializer in tests

Open
#832 0 comments 0 reactions 1 assignee View on GitHub

@spencergibb is already working on this.

Since Mar 21, 2024.

in progress
Dominant language
Java
Stars
822
Forks
539
Avg merge
9h 31m
Merged PRs (30d)
7

Description

Describe the bug
If ConfigDataApplicationContextInitializer is added to tests then properties declared in DynamicPropertySource are not contributed. When I was debugging and put a breakpoint in this class, it was never called.

I did the same for spring-cloud-vault in this example. However, in this case it works.

Locally, I removed those lines and test it similar to the vault example, see changes here, and it worked. Looks like those lines were available since version 3.0.2.

The same happens for spring-cloud-zookeeper and spring-cloud-config. I haven't open issues for those projects yet but if you agree I can do it too.

Sample
https://github.com/eddumelendez/testcontainers-samples/tree/spring-cloud-consul/spring-cloud-consul

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.