Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: quarkusio/quarkus
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 69e66882cb88c17901b912a7abc3b70216476473
Choose a base ref
..
head repository: quarkusio/quarkus
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fb914ec3e8bdabbf3bbbb661be052120d0d1d11c
Choose a head ref
Original file line number Diff line number Diff line change
@@ -441,7 +441,7 @@ public static <T> Optional<T> getConfigValue(Class<?> clientInterface, String fi
}

private static boolean atLeastOnPropertyExists(String configKeyPart, SmallRyeConfig config) {
var allPropertyNames = config.getLatestPropertyNames();
var allPropertyNames = config.getPropertyNames();
for (String propertyName : allPropertyNames) {
if ((propertyName.startsWith(Constants.QUARKUS_CONFIG_PREFIX) && propertyName.contains(configKeyPart))
|| (propertyName.startsWith(configKeyPart) && propertyName.contains(Constants.MP_REST))) {
@@ -452,7 +452,7 @@ private static boolean atLeastOnPropertyExists(String configKeyPart, SmallRyeCon
}

private static boolean atLeastOnPropertyExists(Class<?> interfaceClass, SmallRyeConfig config) {
var allPropertyNames = config.getLatestPropertyNames();
var allPropertyNames = config.getPropertyNames();
for (String propertyName : allPropertyNames) {
if ((propertyName.startsWith(interfaceClass.getName()) && propertyName.contains(Constants.MP_REST))
|| (propertyName.startsWith(Constants.QUARKUS_CONFIG_PREFIX)
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@
import io.quarkus.restclient.config.RestClientConfig;
import io.quarkus.restclient.config.RestClientsConfig;
import io.quarkus.test.QuarkusUnitTest;
import io.smallrye.config.SmallRyeConfig;
import io.smallrye.config.common.AbstractConfigSource;

public class RestClientConfigNotationTest {
@@ -41,6 +42,7 @@ public class RestClientConfigNotationTest {
})
public void testInterfaceConfiguration(final String urlPropertyName) {
TestConfigSource.urlPropertyName = urlPropertyName;
refreshPropertyNames();

RestClientsConfig configRoot = new RestClientsConfig();
RestClientConfig clientConfig = configRoot.getClientConfig(EchoClient.class);
@@ -55,12 +57,19 @@ public void testInterfaceConfiguration(final String urlPropertyName) {
})
public void testConfigKeyConfiguration(final String urlPropertyName) {
TestConfigSource.urlPropertyName = urlPropertyName;
refreshPropertyNames();

RestClientsConfig configRoot = new RestClientsConfig();
RestClientConfig clientConfig = configRoot.getClientConfig("echo-client");

verifyConfig(clientConfig, urlPropertyName);
}

private void refreshPropertyNames() {
SmallRyeConfig config = (SmallRyeConfig) ConfigProvider.getConfig();
config.getLatestPropertyNames();
}

private void verifyConfig(final RestClientConfig clientConfig, final String urlPropertyName) {
ConfigSource configSource = Iterators.find(ConfigProvider.getConfig().getConfigSources().iterator(),
c -> c.getName().equals(TestConfigSource.SOURCE_NAME));