Skip to content

Commit

Permalink
Enable microprofile/tests/tck/tck-config/src/test/tck-suite.xml tests h…
Browse files Browse the repository at this point in the history
…elidon-io#6105

Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
  • Loading branch information
jbescos committed Dec 20, 2023
1 parent 99ab65c commit 82c58c7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,14 @@ private Optional<ConfigValue> findConfigValue(String propertyName) {
LOGGER.log(Level.TRACE, "Found property " + propertyName + " in source " + source.getName());
}
String rawValue = value;
String name = source.getName();
int ordinal = source.getOrdinal();
try {
return applyFilters(propertyName, value)
.map(it -> resolveReferences(propertyName, it))
.map(it -> new ConfigValueImpl(propertyName, it, rawValue, source.getName(), source.getOrdinal()));
.map(it -> new ConfigValueImpl(propertyName, it, rawValue, name, ordinal));
} catch (NoSuchElementException e) {
// Property expression does not resolve
return Optional.empty();
return Optional.of(new ConfigValueImpl(propertyName, null, rawValue, name, ordinal));
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2021 Oracle and/or its affiliates.
* Copyright (c) 2020, 2023 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -49,7 +49,13 @@ public Map<String, String> getProperties() {

@Override
public String getValue(String propertyName) {
return props.getProperty(propertyName);
String key = propertyName;
if (propertyName.startsWith("%")) {
// System properties do not have profiles
int idx = propertyName.indexOf('.');
key = key.substring(idx + 1);
}
return props.getProperty(key);
}

@Override
Expand Down
3 changes: 1 addition & 2 deletions dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@
<version.lib.micronaut>3.8.7</version.lib.micronaut>
<version.lib.micronaut.data>3.4.3</version.lib.micronaut.data>
<version.lib.micronaut.sql>4.8.0</version.lib.micronaut.sql>
<!-- FIXME upgrade to 3.1 when it is released in Maven -->
<version.lib.microprofile-config>3.0.3</version.lib.microprofile-config>
<version.lib.microprofile-config>3.1</version.lib.microprofile-config>
<!-- FIXME upgrade to 4.1 when it is released in Maven -->
<version.lib.microprofile-fault-tolerance-api>4.0.2</version.lib.microprofile-fault-tolerance-api>
<version.lib.microprofile-graphql>2.0</version.lib.microprofile-graphql>
Expand Down
6 changes: 0 additions & 6 deletions microprofile/tests/tck/tck-config/src/test/tck-suite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@
<test name="microprofile-config TCK">
<packages>
<package name="org.eclipse.microprofile.config.tck.*">
<!--
Currently failing because requires this PR:
https://github.com/eclipse/microprofile-config/pull/743
Ignoring meanwhile microprofile-config 3.1 is not released
-->
<exclude name="org.eclipse.microprofile.config.tck.broken"></exclude>
</package>
</packages>
</test>
Expand Down

0 comments on commit 82c58c7

Please sign in to comment.