INT-3749: Get rid of IECA logic
JIRA: https://jira.spring.io/browse/INT-3749 Since `IntegrationEvaluationContextAware` isn't so "context-free" resource like `BeanFactory` and `ApplicationContext`, but just a specific bean in the context, we can't follow with `BeanPostProcessor` logic - bad architecture by level of responsibility. Therefore we should follow with standard Dependency Injection mechanism to retrieve `evaluationContext` for the particular component. Since we can't rely on the `@Autowired` because SI can be used from the raw XML configuration, we use utility method instead. The pattern to get the proper `integrationEvaluationContext` is: ``` @Override protected void onInit() throws Exception { super.onInit(); this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); } ```
This commit is contained in:
committed by
Gary Russell
parent
fe98cbc4e0
commit
3392d4e1ab
@@ -109,7 +109,9 @@ public class SftpInboundRemoteFileSystemSynchronizerTests {
|
||||
filters.add(patternFilter);
|
||||
CompositeFileListFilter<LsEntry> filter = new CompositeFileListFilter<LsEntry>(filters);
|
||||
synchronizer.setFilter(filter);
|
||||
synchronizer.setIntegrationEvaluationContext(ExpressionUtils.createStandardEvaluationContext());
|
||||
synchronizer.setBeanFactory(mock(BeanFactory.class));
|
||||
synchronizer.afterPropertiesSet();
|
||||
|
||||
SftpInboundFileSynchronizingMessageSource ms = new SftpInboundFileSynchronizingMessageSource(synchronizer);
|
||||
ms.setAutoCreateLocalDirectory(true);
|
||||
ms.setLocalDirectory(localDirectoy);
|
||||
|
||||
Reference in New Issue
Block a user