Fix code smell in test and syslog modules (#2667)

* Fix code smell in test and syslog modules

* * Fix code smell in the scripting module
This commit is contained in:
Artem Bilan
2018-12-18 15:58:40 -05:00
committed by Gary Russell
parent 12dd73d219
commit 271181247d
4 changed files with 51 additions and 26 deletions

View File

@@ -148,8 +148,10 @@ public class MockIntegrationContext implements BeanFactoryAware {
}
DirectFieldAccessor directFieldAccessor = new DirectFieldAccessor(endpoint);
Object targetMessageHandler = directFieldAccessor.getPropertyValue("handler");
Assert.notNull(targetMessageHandler, () -> "'handler' must not be null in the: " + endpoint);
if (endpoint instanceof ReactiveStreamsConsumer) {
Object targetSubscriber = directFieldAccessor.getPropertyValue("subscriber");
Assert.notNull(targetSubscriber, () -> "'subscriber' must not be null in the: " + endpoint);
this.beans.put(consumerEndpointId, Tuples.of(targetMessageHandler, targetSubscriber));
}
else {