From 72e1dae93d2a792f19901fd3feaf3681382c0344 Mon Sep 17 00:00:00 2001
From: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
Date: Fri, 18 Sep 2026 18:02:09 +0800
Subject: [PATCH] build(server): raise Byte Buddy so tests run on JDKs newer
than 22
`make test-backend-app` fails on any JDK newer than 22 with 18 errors, all
"Mockito cannot mock this class": 7 in S3StorageServiceTest and 11 in
NotificationServiceTest. Spring Boot 3.2.3 manages Byte Buddy 1.14.12, which
knows class file versions only up to Java 22, so it cannot instrument a mock's
type hierarchy on a newer JVM. It fails identically on a clean tree, so the
pre-PR checklist has been red for reasons unrelated to any change under review.
Overrides the managed version to 1.17.5, which covers Java 24 and 25. The
compile target stays at 21.
Byte Buddy is compile-scoped, reaching Hibernate's runtime bytecode
enhancement and not only Mockito, so this was verified beyond the unit tests:
the application starts, all 65 migrations apply, the logs carry no
enhancement errors, and the staging smoke test passes 15/15. Restoring
1.14.12 brings the 14 S3 mock failures straight back.
Verified:
make test-backend-app BUILD SUCCESS, 0 "cannot mock"
S3StorageServiceTest 14/14
NotificationServiceTest 11/11
scripts/smoke-test.sh against local staging 15/15
---
server/pom.xml | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/server/pom.xml b/server/pom.xml
index 8322b723..7798ebcd 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -22,6 +22,15 @@
21
21
UTF-8
+
+ 1.17.5