Skip to content

Fix duplicated tests - #37317

Draft
noojung wants to merge 1 commit into
spring-projects:mainfrom
noojung:fix-duplicated-tests
Draft

noojung wants to merge 1 commit into
spring-projects:mainfrom
noojung:fix-duplicated-tests

Conversation

@noojung

@noojung noojung commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

I found some tests that tested the same behavior.
This PR updates them to cover distinct scenarios or removes them when they are redundant.

  • JdbcTemplateTests: sqlUpdateWithThreadConnection() duplicated sqlUpdate(). Bind a connection to the current thread and verify that it is reused without being closed.
  • AnnotationExceptionHandlerMethodResolverTests: resolveMethodInherited() duplicated resolveMethodFromAnnotation(). Use InheritedController to verify that exception handler annotations are found on overridden methods in the superclass.
  • TransactionAwareConnectionFactoryProxyTests: getTargetConnectionShouldReturnTargetConnection() duplicated unwrapShouldReturnTargetConnection(). Call ConnectionFactoryUtils.getTargetConnection() instead of unwrap().
  • WebMvcStompWebSocketEndpointRegistrationTests: allowedOrigins() duplicated sameOrigin(). Configure an explicit origin in allowedOrigins() and verify the interceptor's allowed origins in both tests.
  • ExceptionHandlingWebHandlerTests: thrownExceptionBecomesErrorSignal() duplicated handleErrorSignal(). Enable the flag in thrownExceptionBecomesErrorSignal() to cover the catch (Throwable) block in ExceptionHandlingWebHandler. (supersedes Fix thrown exception setup in ExceptionHandlingWebHandlerTests #37233)
  • StringMessageConverterTests: remove fromMessageByteArray(), which duplicated fromByteArrayMessage().
  • SubProtocolWebSocketHandlerTests: remove noSubProtocolNoDefaultHandler(), which duplicated noSubProtocolTwoHandlers().

Signed-off-by: Hyunwoo Jung <hyunwoojung@kakao.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 22, 2026
@noojung
noojung marked this pull request as draft September 22, 2026 09:13

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged or decided on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants