|
31 | 31 | import java.util.concurrent.Executors;
|
32 | 32 | import java.util.concurrent.TimeUnit;
|
33 | 33 |
|
34 |
| -import org.junit.Test; |
| 34 | +import org.junit.jupiter.api.Test; |
35 | 35 | import org.mockito.Mockito;
|
36 | 36 |
|
37 | 37 | import org.springframework.beans.factory.BeanFactory;
|
|
43 | 43 | import org.springframework.core.convert.support.DefaultConversionService;
|
44 | 44 | import org.springframework.core.convert.support.GenericConversionService;
|
45 | 45 | import org.springframework.expression.common.LiteralExpression;
|
| 46 | +import org.springframework.integration.IntegrationPatternType; |
46 | 47 | import org.springframework.integration.annotation.Gateway;
|
47 | 48 | import org.springframework.integration.annotation.GatewayHeader;
|
48 | 49 | import org.springframework.integration.channel.DirectChannel;
|
|
56 | 57 | import org.springframework.messaging.PollableChannel;
|
57 | 58 | import org.springframework.messaging.handler.annotation.Header;
|
58 | 59 | import org.springframework.messaging.support.GenericMessage;
|
| 60 | +import org.springframework.util.ClassUtils; |
59 | 61 | import org.springframework.util.ReflectionUtils;
|
60 | 62 |
|
61 | 63 | /**
|
@@ -156,6 +158,11 @@ public void testReceiveMessage() {
|
156 | 158 | Message<String> message = service.getMessage();
|
157 | 159 | assertThat(message).isNotNull();
|
158 | 160 | assertThat(message.getPayload()).isEqualTo("foo");
|
| 161 | + |
| 162 | + MessagingGatewaySupport messagingGatewaySupport = |
| 163 | + proxyFactory.getGateways().get(ClassUtils.getMethod(TestService.class, "getMessage")); |
| 164 | + assertThat(messagingGatewaySupport.getIntegrationPatternType()) |
| 165 | + .isEqualTo(IntegrationPatternType.outbound_channel_adapter); |
159 | 166 | }
|
160 | 167 |
|
161 | 168 | @Test
|
@@ -259,6 +266,12 @@ public void testNoArgMethodWithPayloadAnnotation() {
|
259 | 266 | TestService service = (TestService) proxyFactory.getObject();
|
260 | 267 | String result = service.requestReplyWithPayloadAnnotation();
|
261 | 268 | assertThat(result).isEqualTo("requestReplyWithPayloadAnnotation0bar");
|
| 269 | + |
| 270 | + MessagingGatewaySupport messagingGatewaySupport = |
| 271 | + proxyFactory.getGateways() |
| 272 | + .get(ClassUtils.getMethod(TestService.class, "requestReplyWithPayloadAnnotation")); |
| 273 | + assertThat(messagingGatewaySupport.getIntegrationPatternType()) |
| 274 | + .isEqualTo(IntegrationPatternType.inbound_gateway); |
262 | 275 | }
|
263 | 276 |
|
264 | 277 | @Test
|
|
0 commit comments