File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed
main/java/io/scalecube/config
test/java/io/scalecube/config Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -86,8 +86,7 @@ private boolean isMultimap(ParameterizedType paramType) {
8686 } else if (type == Long .TYPE || type == Long .class ) {
8787 return Long ::parseLong ;
8888 } else {
89- throw new IllegalArgumentException (
90- "ObjectPropertyField: unsupported type on field: " + field );
89+ return Function .identity ();
9190 }
9291 }
9392
Original file line number Diff line number Diff line change @@ -401,6 +401,27 @@ void testSkipStaticOrFinalFieldInObjectPropertryClass() {
401401 assertEquals (1 , config .finalInt );
402402 }
403403
404+ @ Test
405+ void testSkipInjectedConfigPojo () {
406+ when (configSource .loadConfig ())
407+ .thenReturn (
408+ toConfigProps (
409+ mapBuilder ()
410+ .put ("io.scalecube.config.user" , "user" )
411+ .put ("io.scalecube.config.password" , "password" )
412+ .build ()));
413+
414+ ConfigRegistryImpl configRegistry = newConfigRegistry (configSource );
415+
416+ final SkipInjectedConfigPojo configPojo =
417+ configRegistry .objectProperty (SkipInjectedConfigPojo .class ).value ().get ();
418+
419+ assertEquals ("user" , configPojo .user );
420+ assertEquals ("password" , configPojo .password );
421+ assertNotNull (configPojo .testConfig );
422+ assertNotNull (configPojo .intObjectSettings );
423+ }
424+
404425 // Failure scenarios
405426
406427 @ Test
@@ -552,4 +573,11 @@ public static class ConnectorSettings {
552573 public static class IntObjectSettings {
553574 int anInt ;
554575 }
576+
577+ public static class SkipInjectedConfigPojo {
578+ String user ;
579+ String password ;
580+ IntObjectSettings intObjectSettings = new IntObjectSettings ();
581+ TestConfig testConfig = new TestConfig ();
582+ }
555583}
You can’t perform that action at this time.
0 commit comments