Fix BeanFactory propagation for MMInvokerHelper (#2694)

* Fix BeanFactory propagation for MMInvokerHelper

* Remove check for `null` in the
`MessagingMethodInvokerHelper.isProvidedMessageHandlerFactoryBean()`
* Fix `RecipientListRouter` for `BeanFactory` propagation to the
`Recipient.selector`
* Fix tests for `BeanFactory` population and propagation
* Add `errorChannel` into the `TestUtils.createTestApplicationContext()`
* Fix some Sonar smell, including new reported

* * Restore NPE check for the `BeanFactory` in the
`MessagingMethodInvokerHelper` to avoid breaking changes in the current
point release
* Some other polishing and optimizations in the
`MessagingMethodInvokerHelper`
This commit is contained in:
Artem Bilan
2019-01-15 15:16:33 -05:00
committed by Gary Russell
parent 63684e2012
commit eed16f02ca
47 changed files with 1164 additions and 680 deletions

View File

@@ -52,6 +52,8 @@ import org.springframework.util.StringUtils;
*/
public abstract class TestUtils {
private static final Log LOGGER = LogFactory.getLog(TestUtils.class);
/**
* Obtain a value for the property from the provide object.
* Supports nested properties via period delimiter.
@@ -114,6 +116,11 @@ public abstract class TestUtils {
scheduler.setErrorHandler(errorHandler);
registerBean("taskScheduler", scheduler, context);
registerBean("integrationConversionService", new DefaultFormattingConversionService(), context);
registerBean("errorChannel",
(MessageChannel) (message, timeout) -> {
LOGGER.error(message);
return true;
}, context);
return context;
}