From 5313c42e17e5bb38c9e7dab16cda83231580f5e6 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Fri, 6 Dec 2024 09:27:02 -0500 Subject: [PATCH] Some `SimpleMessageGroupTests.testPerformance()` optimization --- .../integration/store/SimpleMessageGroupTests.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-integration-core/src/test/java/org/springframework/integration/store/SimpleMessageGroupTests.java b/spring-integration-core/src/test/java/org/springframework/integration/store/SimpleMessageGroupTests.java index 6e554fd812..457e350564 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/store/SimpleMessageGroupTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/store/SimpleMessageGroupTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2023 the original author or authors. + * Copyright 2009-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -106,8 +106,9 @@ public class SimpleMessageGroupTests { SimpleMessageGroup group = new SimpleMessageGroup(messages, this.key); StopWatch watch = new StopWatch(); watch.start(); + Collection> messagesInGroup = group.getMessages(); for (Message message : messages) { - assertThat(group.getMessages().contains(message)).isTrue(); + assertThat(messagesInGroup.contains(message)).isTrue(); } watch.stop(); assertThat(watch.getTotalTimeMillis()).isLessThan(5000);