Skip to content

Changes

Started 12 hr ago
Took 50 sec on Builder

Summary

  1. Fix registry bootstrap stubbing failing under CI test ordering (commit: 0d7e08f) (details)
Commit 0d7e08f00bfff4790a205caf1d14eb36286c24c8 by nossr50
Fix registry bootstrap stubbing failing under CI test ordering

The per-type registry mock minted its lookups through a when() stub
registered inside the Bukkit.getRegistry interception, which runs in
the middle of Registry class initialization. Mockito stubbing state
is thread-local and unreliable while an intercepted invocation is
being answered: on the CI runner the stub silently failed to bind,
lookups returned null, and PotionEffectType class init failed with
"No PotionEffectType found for minecraft:speed", poisoning the class
for the JVM and erroring 108 tests. Locally a different test order
made another class perform the first bootstrap, where the nested
stubbing happened to bind.

The minting now lives in the mock's default answer, baked in at
creation with no stubbing machinery involved, and also covers
getOrThrow for newer API versions. Explicit per-key when() stubs from
test bodies still override the default answer.
(commit: 0d7e08f)
The file was modifiedsrc/test/java/com/gmail/nossr50/TestRegistryBootstrap.java (diff)