Skip to content

Commit 777c84f

Browse files
committed
An attempt to fix OOM in the RecipientListRouterParserTests
* Add `@DirtiesContext` to the `RecipientListRouterParserTests` * Remove manual `context.start();` since it is started by the `@SpringJUnitConfig` anyway
1 parent b2a3d25 commit 777c84f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

spring-integration-core/src/test/java/org/springframework/integration/router/config/RecipientListRouterParserTests.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -28,6 +28,7 @@
2828
import org.springframework.messaging.MessageChannel;
2929
import org.springframework.messaging.PollableChannel;
3030
import org.springframework.messaging.support.GenericMessage;
31+
import org.springframework.test.annotation.DirtiesContext;
3132
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
3233

3334
import static org.assertj.core.api.Assertions.assertThat;
@@ -40,6 +41,7 @@
4041
* @since 1.0.3
4142
*/
4243
@SpringJUnitConfig
44+
@DirtiesContext
4345
public class RecipientListRouterParserTests {
4446

4547
@Autowired
@@ -57,7 +59,6 @@ public class RecipientListRouterParserTests {
5759

5860
@Test
5961
public void checkMessageRouting() {
60-
context.start();
6162
Message<?> message = new GenericMessage<>(1);
6263
channel.send(message);
6364
PollableChannel chanel1 = (PollableChannel) context.getBean("channel1");
@@ -93,7 +94,6 @@ public void customRouter() {
9394

9495
@Test
9596
public void simpleDynamicRouter() {
96-
context.start();
9797
Message<?> message = new GenericMessage<>(1);
9898
simpleDynamicInput.send(message);
9999
PollableChannel chanel1 = (PollableChannel) context.getBean("channel1");
@@ -104,7 +104,6 @@ public void simpleDynamicRouter() {
104104

105105
@Test
106106
public void noSelectorMatchRouter() {
107-
context.start();
108107
Message<?> message = new GenericMessage<>(1);
109108
noSelectorMatchInput.send(message);
110109
PollableChannel chanel1 = (PollableChannel) context.getBean("channel1");

0 commit comments

Comments
 (0)