Skip to content

Commit

Permalink
Strict config lookup for the REST Client
Browse files Browse the repository at this point in the history
  • Loading branch information
radcortez committed Sep 20, 2024
1 parent cbb7331 commit 18216d0
Show file tree
Hide file tree
Showing 30 changed files with 755 additions and 1,057 deletions.
2 changes: 1 addition & 1 deletion bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<microprofile-lra.version>2.0</microprofile-lra.version>
<microprofile-openapi.version>3.1.1</microprofile-openapi.version>
<smallrye-common.version>2.6.0</smallrye-common.version>
<smallrye-config.version>3.9.1</smallrye-config.version>
<smallrye-config.version>3.9.1-SNAPSHOT</smallrye-config.version>
<smallrye-health.version>4.1.0</smallrye-health.version>
<smallrye-metrics.version>4.0.0</smallrye-metrics.version>
<smallrye-open-api.version>3.12.0</smallrye-open-api.version>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@ public class RegisteredRestClient {
private final String fullName;
private final String simpleName;
private final String configKey;
private final boolean configKeySegments;
private final boolean configKeyComposed;

public RegisteredRestClient(final String fullName, final String simpleName) {
this(fullName, simpleName, null);
}

public RegisteredRestClient(final Class<?> client, final String configKey) {
this(client.getName(), client.getSimpleName(), configKey);
}

public RegisteredRestClient(final String fullName, final String simpleName, final String configKey) {
this.fullName = fullName;
this.simpleName = simpleName;
this.configKey = configKey;
this.configKeySegments = configKey != null && new NameIterator(configKey).nextSegmentEquals(configKey);
this.configKeyComposed = configKey != null && new NameIterator(configKey).nextSegmentEquals(configKey);
}

public String getFullName() {
Expand All @@ -31,10 +35,10 @@ public String getConfigKey() {
return configKey;
}

public boolean isConfigKeySegments() {
public boolean isConfigKeyComposed() {
if (configKey == null) {
throw new IllegalStateException("configKey is null");
}
return !configKeySegments;
return !configKeyComposed;
}
}

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 18216d0

Please sign in to comment.