Skip to content

Commit 5313c42

Browse files
committed
Some SimpleMessageGroupTests.testPerformance() optimization
1 parent 2cf83b5 commit 5313c42

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-integration-core/src/test/java/org/springframework/integration/store/SimpleMessageGroupTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-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.
@@ -106,8 +106,9 @@ public void testPerformance() {
106106
SimpleMessageGroup group = new SimpleMessageGroup(messages, this.key);
107107
StopWatch watch = new StopWatch();
108108
watch.start();
109+
Collection<Message<?>> messagesInGroup = group.getMessages();
109110
for (Message<?> message : messages) {
110-
assertThat(group.getMessages().contains(message)).isTrue();
111+
assertThat(messagesInGroup.contains(message)).isTrue();
111112
}
112113
watch.stop();
113114
assertThat(watch.getTotalTimeMillis()).isLessThan(5000);

0 commit comments

Comments
 (0)