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
This commit is contained in:
XiaoSeS 2026-09-18 18:02:09 +08:00
parent f87849fe3e
commit 72e1dae93d

View file

@ -22,6 +22,15 @@
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!--
Spring Boot 3.2.3 manages Byte Buddy 1.14.12, which knows class file versions up to
Java 22. The build targets Java 21, but a contributor running a newer JDK executes the
tests on that JVM, and Mockito then fails with "Mockito cannot mock this class" for
every mock whose type hierarchy it must instrument. That is a toolchain gap, not a code
fault. Overriding the managed version keeps mocking usable on newer JDKs while leaving
the compile target at 21.
-->
<byte-buddy.version>1.17.5</byte-buddy.version>
</properties>
<modules>