Skip to content

Commit 3580804

Browse files
committed
Fix generics warning for AssertJ in the RouterTests
* Fix couple `foo/bar` in the `RouterTests` and `StompServerIntegrationTests`
1 parent 378258e commit 3580804

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

spring-integration-core/src/test/java/org/springframework/integration/dsl/routers/RouterTests.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ public void testRouterWithTwoSubflows() {
139139
public void testRouterSubflowWithReplyChannelHeader() {
140140
PollableChannel replyChannel = new QueueChannel();
141141
this.routeSubflowToReplyChannelFlowInput.send(
142-
MessageBuilder.withPayload("baz")
142+
MessageBuilder.withPayload("test")
143143
.setReplyChannel(replyChannel)
144144
.build());
145145

146146
Message<?> receive = replyChannel.receive(10000);
147147
assertThat(receive).isNotNull();
148-
assertThat(receive.getPayload()).isEqualTo("BAZ");
148+
assertThat(receive.getPayload()).isEqualTo("TEST");
149149
}
150150

151151
@Autowired
@@ -158,13 +158,13 @@ public void testRouterSubflowWithReplyChannelHeader() {
158158

159159
@Test
160160
public void testRouterSubflowWithoutReplyToMainFlow() {
161-
this.routeSubflowWithoutReplyToMainFlowInput.send(new GenericMessage<>("BOO"));
161+
this.routeSubflowWithoutReplyToMainFlowInput.send(new GenericMessage<>("TEST"));
162162

163163
Message<?> receive = routerSubflowResult.receive(10000);
164164
assertThat(receive).isNotNull();
165-
assertThat(receive.getPayload()).isEqualTo("boo");
165+
assertThat(receive.getPayload()).isEqualTo("test");
166166
assertThat(this.defaultOutputChannel.receive(1)).isNull();
167-
this.routeSubflowWithoutReplyToMainFlowInput.send(new GenericMessage<>("foo"));
167+
this.routeSubflowWithoutReplyToMainFlowInput.send(new GenericMessage<>("wrong"));
168168
assertThat(this.defaultOutputChannel.receive(10000)).isNotNull();
169169
}
170170

@@ -475,7 +475,7 @@ public void testScatterGather() {
475475
.hasSizeGreaterThanOrEqualTo(1)
476476
.first()
477477
.asInstanceOf(InstanceOfAssertFactories.type(Message.class))
478-
.extracting(Message::getHeaders)
478+
.extracting("headers")
479479
.asInstanceOf(InstanceOfAssertFactories.MAP)
480480
.extractingByKey("gatherResultChannel")
481481
.isNotInstanceOf(PollableChannel.class);
@@ -667,7 +667,7 @@ public IntegrationFlow routeSubflowToReplyChannelFlow() {
667667
@Bean
668668
public IntegrationFlow routeSubflowWithoutReplyToMainFlow() {
669669
return f -> f
670-
.<String, Boolean>route("BOO"::equals, m -> m
670+
.<String, Boolean>route("TEST"::equals, m -> m
671671
.resolutionRequired(false)
672672
.subFlowMapping(true, sf -> sf
673673
.transform(String.class, String::toLowerCase)

spring-integration-stomp/src/test/java/org/springframework/integration/stomp/client/StompServerIntegrationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public void testStompAdapters() throws Exception {
210210
while (!(eventMessage.getPayload() instanceof StompConnectionFailedEvent) && n++ < 100);
211211

212212
assertThatExceptionOfType(MessageDeliveryException.class)
213-
.isThrownBy(() -> stompOutputChannel1.send(new GenericMessage<>("foo".getBytes())))
213+
.isThrownBy(() -> stompOutputChannel1.send(new GenericMessage<>("test".getBytes())))
214214
.withMessageContaining("could not deliver message");
215215

216216
broker.start();
@@ -228,10 +228,10 @@ public void testStompAdapters() throws Exception {
228228
}
229229
while (!(eventMessage.getPayload() instanceof StompReceiptEvent));
230230

231-
stompOutputChannel1.send(new GenericMessage<>("foo".getBytes()));
231+
stompOutputChannel1.send(new GenericMessage<>("test".getBytes()));
232232
Message<?> receive25 = stompInputChannel2.receive(10000);
233233
assertThat(receive25).isNotNull();
234-
assertThat((byte[]) receive25.getPayload()).isEqualTo("foo".getBytes());
234+
assertThat((byte[]) receive25.getPayload()).isEqualTo("test".getBytes());
235235

236236
context1.close();
237237
context2.close();

0 commit comments

Comments
 (0)