Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nilshartmann/spring-boot-3-4-dynamic_properties
https://github.com/nilshartmann/spring-boot-3-4-dynamic_properties
Last synced: about 8 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/nilshartmann/spring-boot-3-4-dynamic_properties
- Owner: nilshartmann
- Created: 2024-08-13T15:31:35.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-13T15:38:27.000Z (3 months ago)
- Last Synced: 2024-08-13T18:51:12.279Z (3 months ago)
- Language: Java
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Demo: `DynamicPropertyRegistry` in `@Bean` does not work in Spring Boot 3.4
## How to run
**Mit Spring Boot 3.3.2**
```bash
cd 3_3_2
./mvwn clean package
```
- Tests will run **successfully*
**Mit Spring Boot 3.4.0-M1**
```bash
cd 3_4_0_M1
./mvwn clean package
```- Tests will **fail* with error:
```
***************************
APPLICATION FAILED TO START
***************************Description:
Parameter 0 of method dummyService in com.example.demo.DemoTestConfig required a single bean, but 2 were found:
- dynamicPropertyRegistry: defined by method 'dynamicPropertyRegistry' in class path resource [org/springframework/boot/testcontainers/properties/TestcontainersPropertySourceAutoConfiguration.class]
- org.springframework.test.context.support.DynamicPropertiesContextCustomizer.dynamicPropertyRegistry: a programmatically registered singleton
```- Remove dependency `org.springframework.boot:spring-boot-testcontainers` from `pom.xml` and run again: Test will run **successfully**