Search in ancestors for bean of type ConfigClientProperties

Before this change we check that it is there, then don't look in the
ancestors. A test would be useful.

Fixes gh-191
This commit is contained in:
Kees Koffeman
2015-07-08 14:15:53 +02:00
committed by Dave Syer
parent 1a0e6689dc
commit ccc44db8eb

View File

@@ -44,7 +44,7 @@ public class ConfigClientAutoConfiguration {
if (context.getParent() != null
&& BeanFactoryUtils.beanNamesForTypeIncludingAncestors(
context.getParent(), ConfigClientProperties.class).length > 0) {
return BeanFactoryUtils.beanOfType(context.getParent(),
return BeanFactoryUtils.beanOfTypeIncludingAncestors(context.getParent(),
ConfigClientProperties.class);
}
ConfigClientProperties client = new ConfigClientProperties(environment);