Skip to content

Commit 071c013

Browse files
committed
Merge branch '3.4.x'
Closes gh-45332
2 parents 75fe588 + 5709d55 commit 071c013

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketMessagingAutoConfigurationTests.java

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 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.
@@ -52,7 +52,6 @@
5252
import org.springframework.core.annotation.Order;
5353
import org.springframework.core.task.AsyncTaskExecutor;
5454
import org.springframework.core.task.SimpleAsyncTaskExecutor;
55-
import org.springframework.core.task.TaskExecutor;
5655
import org.springframework.messaging.converter.CompositeMessageConverter;
5756
import org.springframework.messaging.converter.MessageConverter;
5857
import org.springframework.messaging.converter.SimpleMessageConverter;
@@ -65,7 +64,6 @@
6564
import org.springframework.messaging.simp.stomp.StompSession;
6665
import org.springframework.messaging.simp.stomp.StompSessionHandler;
6766
import org.springframework.messaging.simp.stomp.StompSessionHandlerAdapter;
68-
import org.springframework.security.util.FieldUtils;
6967
import org.springframework.stereotype.Component;
7068
import org.springframework.stereotype.Controller;
7169
import org.springframework.web.client.RestTemplate;
@@ -144,27 +142,25 @@ void customizedConverterTypesMatchDefaultConverterTypes() {
144142
}
145143

146144
@Test
147-
void predefinedThreadExecutorIsSelectedForInboundChannel() throws Throwable {
145+
void predefinedThreadExecutorIsSelectedForInboundChannel() {
148146
AsyncTaskExecutor expectedExecutor = new SimpleAsyncTaskExecutor();
149147
ChannelRegistration registration = new ChannelRegistration();
150148
WebSocketMessagingAutoConfiguration.WebSocketMessageConverterConfiguration configuration = new WebSocketMessagingAutoConfiguration.WebSocketMessageConverterConfiguration(
151149
new ObjectMapper(),
152150
Map.of(TaskExecutionAutoConfiguration.APPLICATION_TASK_EXECUTOR_BEAN_NAME, expectedExecutor));
153151
configuration.configureClientInboundChannel(registration);
154-
TaskExecutor executor = (TaskExecutor) FieldUtils.getFieldValue(registration, "executor");
155-
assertThat(executor).isEqualTo(expectedExecutor);
152+
assertThat(registration).extracting("executor").isEqualTo(expectedExecutor);
156153
}
157154

158155
@Test
159-
void predefinedThreadExecutorIsSelectedForOutboundChannel() throws Throwable {
156+
void predefinedThreadExecutorIsSelectedForOutboundChannel() {
160157
AsyncTaskExecutor expectedExecutor = new SimpleAsyncTaskExecutor();
161158
ChannelRegistration registration = new ChannelRegistration();
162159
WebSocketMessagingAutoConfiguration.WebSocketMessageConverterConfiguration configuration = new WebSocketMessagingAutoConfiguration.WebSocketMessageConverterConfiguration(
163160
new ObjectMapper(),
164161
Map.of(TaskExecutionAutoConfiguration.APPLICATION_TASK_EXECUTOR_BEAN_NAME, expectedExecutor));
165162
configuration.configureClientOutboundChannel(registration);
166-
TaskExecutor executor = (TaskExecutor) FieldUtils.getFieldValue(registration, "executor");
167-
assertThat(executor).isEqualTo(expectedExecutor);
163+
assertThat(registration).extracting("executor").isEqualTo(expectedExecutor);
168164
}
169165

170166
@Test

0 commit comments

Comments
 (0)