|
42 | 42 | import org.springframework.context.ApplicationEvent; |
43 | 43 | import org.springframework.context.ApplicationEventPublisher; |
44 | 44 | import org.springframework.integration.channel.QueueChannel; |
| 45 | +import org.springframework.integration.ip.IpHeaders; |
45 | 46 | import org.springframework.integration.ip.tcp.connection.AbstractServerConnectionFactory; |
46 | 47 | import org.springframework.integration.ip.tcp.connection.TcpNioServerConnectionFactory; |
47 | 48 | import org.springframework.integration.ip.udp.UnicastReceivingChannelAdapter; |
@@ -84,6 +85,7 @@ public void testUdp() throws Exception { |
84 | 85 | Message<?> message = outputChannel.receive(10000); |
85 | 86 | assertThat(message).isNotNull(); |
86 | 87 | assertThat(message.getHeaders().get("syslog_HOST")).isEqualTo("WEBERN"); |
| 88 | + assertThat(message.getHeaders().get(IpHeaders.IP_ADDRESS)).isNotNull(); |
87 | 89 | adapter.stop(); |
88 | 90 | } |
89 | 91 |
|
@@ -128,6 +130,7 @@ public void testTcp() throws Exception { |
128 | 130 | Message<?> message = outputChannel.receive(10000); |
129 | 131 | assertThat(message).isNotNull(); |
130 | 132 | assertThat(message.getHeaders().get("syslog_HOST")).isEqualTo("WEBERN"); |
| 133 | + assertThat(message.getHeaders().get(IpHeaders.IP_ADDRESS)).isNotNull(); |
131 | 134 | adapter.stop(); |
132 | 135 | assertThat(latch.await(10, TimeUnit.SECONDS)).isTrue(); |
133 | 136 | } |
@@ -161,6 +164,7 @@ public void testAsMapFalse() throws Exception { |
161 | 164 | assertThat(message.getHeaders().get("syslog_HOST")).isEqualTo("WEBERN"); |
162 | 165 | assertThat(new String((byte[]) message.getPayload(), "UTF-8")) |
163 | 166 | .isEqualTo("<157>JUL 26 22:08:35 WEBERN TESTING[70729]: TEST SYSLOG MESSAGE"); |
| 167 | + assertThat(message.getHeaders().get(IpHeaders.IP_ADDRESS)).isNotNull(); |
164 | 168 | adapter.stop(); |
165 | 169 | } |
166 | 170 |
|
@@ -210,6 +214,7 @@ public void testTcpRFC5424() throws Exception { |
210 | 214 | Message<Map<String, ?>> message = (Message<Map<String, ?>>) outputChannel.receive(10000); |
211 | 215 | assertThat(message).isNotNull(); |
212 | 216 | assertThat(message.getPayload().get("syslog_HOST")).isEqualTo("loggregator"); |
| 217 | + assertThat(message.getHeaders().get(IpHeaders.IP_ADDRESS)).isNotNull(); |
213 | 218 | adapter.stop(); |
214 | 219 | assertThat(latch.await(10, TimeUnit.SECONDS)).isTrue(); |
215 | 220 | } |
@@ -243,6 +248,7 @@ public void testUdpRFC5424() throws Exception { |
243 | 248 | Message<Map<String, ?>> message = (Message<Map<String, ?>>) outputChannel.receive(10000); |
244 | 249 | assertThat(message).isNotNull(); |
245 | 250 | assertThat(message.getPayload().get("syslog_HOST")).isEqualTo("loggregator"); |
| 251 | + assertThat(message.getHeaders().get(IpHeaders.IP_ADDRESS)).isNotNull(); |
246 | 252 | adapter.stop(); |
247 | 253 | } |
248 | 254 |
|
|
0 commit comments