You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our team supports a simple service that exposes a handful of APIs. For the purposes of fast iteration, we're loading all of our "data" into a config entry in our application.yaml.
The structure of the YAML looks like this (data anonymized, but it resembles the actual structure)
The main issue is that Quarkus will load into the "home" entry whichever array is greater. It does not respect the property set for that specific profile.
Test
package com.mypackage;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.List;
import java.util.Map;
import jakarta.inject.Inject;
import io.quarkus.test.junit.QuarkusTest;
import org.junit.jupiter.api.Test;
@QuarkusTest
public class AppConfigMappingTest {
@Inject
AppConfigMapping appConfigMapping;
@Test
public void isMockDataShapedCorrectly() {
Map<String, List<AppConfigMapping.Component>> components =
appConfigMapping.service().mockData().components();
assertThat(components).isNotNull();
assertThat(components.get("home")).isNotEmpty().hasSize(1); // Fails, size of the array is 3
}
}
For example, when we ran this test against these config entries, the home key, consistently returned:
Describe the bug
Our team supports a simple service that exposes a handful of APIs. For the purposes of fast iteration, we're loading all of our "data" into a config entry in our
application.yaml
.The structure of the YAML looks like this (data anonymized, but it resembles the actual structure)
There is also an instance of a
@ConfigMapping
object that looks like this:The main issue is that Quarkus will load into the "home" entry whichever array is greater. It does not respect the property set for that specific profile.
Test
For example, when we ran this test against these config entries, the
home
key, consistently returned:Expected behavior
The expected behavior is that when we run the same test in the description, the key "home" should return a list of 1 element consisting of this value:
Actual behavior
The actual behavior is that when we run the same test in the description, the key "home" returns a list of 3 elements consisting of these values:
How to Reproduce?
Reproducer: config-mapping-bug.zip
Steps to reproduce:
quarkus test
Output of
uname -a
orver
Darwin MacBook-Pro.local 24.1.0 Darwin Kernel Version 24.1.0: Thu Oct 10 21:00:32 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6030 arm64
Output of
java -version
openjdk 21 2023-09-19 LTS OpenJDK Runtime Environment Temurin-21+35 (build 21+35-LTS) OpenJDK 64-Bit Server VM Temurin-21+35 (build 21+35-LTS, mixed mode)
Quarkus version or git rev
3.17.4
Build tool (ie. output of
mvnw --version
orgradlew --version
)------------------------------------------------------------ Gradle 8.8 ------------------------------------------------------------ Build time: 2024-05-31 21:46:56 UTC Revision: 4bd1b3d3fc3f31db5a26eecb416a165b8cc36082 Kotlin: 1.9.22 Groovy: 3.0.21 Ant: Apache Ant(TM) version 1.10.13 compiled on January 4 2023 JVM: 21 (Eclipse Adoptium 21+35-LTS) OS: Mac OS X 15.1.1 aarch64
Additional information
No response
The text was updated successfully, but these errors were encountered: