Re-enable ignored tests

This commit is contained in:
Oleg Zhurakousky
2020-05-04 20:44:10 +02:00
parent c82d0f6ca5
commit e3ee776c04
6 changed files with 15 additions and 12 deletions

View File

@@ -32,6 +32,7 @@ import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.BeanFactoryAnnotationUtils;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.cloud.function.context.FunctionCatalog;
@@ -110,6 +111,14 @@ public class BeanFactoryAwareFunctionRegistry extends SimpleFunctionRegistry imp
@Override
Object locateFunction(String name) {
Object function = super.locateFunction(name);
if (function == null) {
try {
function = BeanFactoryAnnotationUtils.qualifiedBeanOfType(this.applicationContext.getBeanFactory(), Object.class, name);
}
catch (Exception e) {
// ignore
}
}
if (function == null && this.applicationContext.containsBean(name)) {
function = this.applicationContext.getBean(name);
}