Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration Mapper #333

Merged
merged 42 commits into from
Jul 31, 2020
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
9aa768b
Configuration mapper
dmlloyd May 11, 2020
f699816
Fix compilation issues after master merge.
radcortez Jun 16, 2020
db7304e
Move ConfigMapping classes to integrate with SmallRyeConfig.
radcortez Jun 16, 2020
c7ab4ce
Remove mapper project, but kept code if we need to retrieve additiona…
radcortez Jun 17, 2020
d7075e8
Ignore properties validation for unregistered roots.
radcortez Jun 17, 2020
e45f2df
Support Bean style methods.
radcortez Jun 17, 2020
bce4822
Support optional mapping registration in the SmallRyeBuilder.
radcortez Jun 17, 2020
a6875df
Moved generic APIs to main package.
radcortez Jun 17, 2020
5a737a8
Support empty root prefix.
radcortez Jun 29, 2020
116daeb
Add Collections tests.
radcortez Jun 29, 2020
0746069
ConfigMapping defaults with Config.
radcortez Jun 29, 2020
7b6f080
ConfigMapping Converter test.
radcortez Jun 29, 2020
c92e450
Fixed ConfigMapping simple Optionals.
radcortez Jun 30, 2020
6fa6f5c
Remove unused class.
radcortez Jun 30, 2020
560d7d6
Added tests and fixed ConfigMapping Map support.
radcortez Jun 30, 2020
fd7ec82
Added a few more tests to ConfigMapping.
radcortez Jun 30, 2020
13394f3
Rename ConfigMapping to ConfigMappingProvider (to add annotation with…
radcortez Jun 30, 2020
e779b46
Move mapping annotations that can be used outside mapping context.
radcortez Jun 30, 2020
681281f
Remove unused mapper code.
radcortez Jun 30, 2020
4e1d0b2
Removed ConfigMapping on the fly.
radcortez Jul 14, 2020
700100c
Remove JavaBeans getter style method names.
radcortez Jul 14, 2020
1ea215e
Use KeyMap for default values.
radcortez Jul 15, 2020
2ab22a0
Add mapping ignores in the builder.
radcortez Jul 15, 2020
fd47521
Fixed formatting.
radcortez Jul 15, 2020
9e75bfb
Added javadoc to ConfigurationValidationException.
radcortez Jul 16, 2020
c2a84ec
Add configuration property for ConfigMapping debug.
radcortez Jul 16, 2020
d3cae3e
Don't add additional KeyMap on empty paths.
radcortez Jul 16, 2020
98b2ea6
Some code cleanup.
radcortez Jul 16, 2020
07abf93
Validate ConfigMapping on Builder.
radcortez Jul 17, 2020
1428b2a
DefaultConfigSource return empty map.
radcortez Jul 17, 2020
4088829
Improve KeyMap.toString performance.
radcortez Jul 17, 2020
f13b079
Moved ConfigValidationException to main package.
radcortez Jul 17, 2020
1dc64d4
Added Config Mappings directly into SmallRyeConfig.
radcortez Jul 17, 2020
73ffd2f
Added doPrivileged to System property lookup.
radcortez Jul 17, 2020
38fd880
Removed mapper package to remove public access to ConfigMapping classes.
radcortez Jul 23, 2020
7d19772
Better encapsulation of ConfigMapping data and SmallRyeConfig.
radcortez Jul 23, 2020
c7f122c
Fix visibilities if generated class is from different package.
radcortez Jul 24, 2020
a9e0ad3
Initial CDI support for ConfigMapping.
radcortez Jul 24, 2020
5ee3783
Generate classes in the mapper package.
radcortez Jul 24, 2020
547ecea
Use ClassDefiner from SmallRye Commons Classloader instead of Unsafe.
radcortez Jul 30, 2020
942a132
Improve SmallRyeConfig and ConfigMappings integration.
radcortez Jul 30, 2020
40ec717
Remove toMap from KeyMap.
radcortez Jul 31, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
DefaultConfigSource return empty map.
radcortez committed Jul 31, 2020
commit 1428b2ae5a9a2054e7a4481ac6159ed4f6716fae
Original file line number Diff line number Diff line change
@@ -88,6 +88,11 @@ private List<ConfigSource> buildConfigSources(final SmallRyeConfigBuilder builde
sourcesToBuild.add(new KeyMapBackedConfigSource("DefaultValuesConfigSource", defaultValues) {
private static final long serialVersionUID = 7847969724478280439L;

@Override
public Map<String, String> getProperties() {
return new HashMap<>();
}

@Override
public int getOrdinal() {
return Integer.MIN_VALUE;
Original file line number Diff line number Diff line change
@@ -2,7 +2,9 @@

import static io.smallrye.config.KeyValuesConfigSource.config;
import static java.util.stream.Collectors.toList;
import static java.util.stream.StreamSupport.stream;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -268,6 +270,9 @@ void defaults() {
assertEquals("foo", defaults.foo());
assertEquals("bar", defaults.bar());
assertEquals("foo", config.getRawValue("foo"));

final List<String> propertyNames = stream(config.getPropertyNames().spliterator(), false).collect(toList());
assertFalse(propertyNames.contains("foo"));
}

@Test