Skip to content

Commit 7815c82

Browse files
committed
Remove direct initialization of IntegrationProperties.
Signed-off-by: Jiandong Ma <[email protected]>
1 parent 05ee9ff commit 7815c82

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationObjectSupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public abstract class IntegrationObjectSupport implements ComponentSourceAware,
8181

8282
private TaskScheduler taskScheduler;
8383

84-
private IntegrationProperties integrationProperties = new IntegrationProperties();
84+
private IntegrationProperties integrationProperties;
8585

8686
private ConversionService conversionService;
8787

spring-integration-core/src/test/java/org/springframework/integration/endpoint/ExpressionEvaluatingMessageSourceIntegrationTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -75,6 +75,7 @@ public void test() throws Exception {
7575
adapter.setErrorHandler(t -> {
7676
throw new IllegalStateException("unexpected exception in test", t);
7777
});
78+
adapter.afterPropertiesSet();
7879
adapter.start();
7980
List<Message<?>> messages = new ArrayList<>();
8081
for (int i = 0; i < 3; i++) {

spring-integration-core/src/test/java/org/springframework/integration/handler/MessageHandlerChainTests.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -79,6 +79,7 @@ public void chainWithOutputChannel() {
7979
chain.setHandlers(handlers);
8080
chain.setOutputChannel(outputChannel);
8181
chain.setBeanFactory(mock(BeanFactory.class));
82+
chain.afterPropertiesSet();
8283
chain.handleMessage(message);
8384
Mockito.verify(outputChannel).send(Mockito.eq(message), eq(30000L));
8485
}
@@ -107,6 +108,7 @@ public void chainWithoutOutputChannelButLastHandlerDoesNotProduceReplies() {
107108
chain.setBeanName("testChain");
108109
chain.setHandlers(handlers);
109110
chain.setBeanFactory(mock(BeanFactory.class));
111+
chain.afterPropertiesSet();
110112
chain.handleMessage(message);
111113
}
112114

@@ -121,6 +123,7 @@ public void chainForwardsToReplyChannel() {
121123
chain.setBeanName("testChain");
122124
chain.setHandlers(handlers);
123125
chain.setBeanFactory(mock(BeanFactory.class));
126+
chain.afterPropertiesSet();
124127
chain.handleMessage(message);
125128
Mockito.verify(outputChannel).send(Mockito.any(Message.class), eq(30000L));
126129
}
@@ -138,6 +141,7 @@ public void chainResolvesReplyChannelName() {
138141
chain.setBeanName("testChain");
139142
chain.setHandlers(handlers);
140143
chain.setBeanFactory(beanFactory);
144+
chain.afterPropertiesSet();
141145
chain.handleMessage(message);
142146
Mockito.verify(outputChannel).send(Mockito.eq(message), eq(30000L));
143147
}

0 commit comments

Comments
 (0)