From f69f3fa30a6c695748ae3cecc8ff80354887ee59 Mon Sep 17 00:00:00 2001 From: David Alvarez Date: Tue, 9 Jun 2026 14:04:49 +0200 Subject: [PATCH] fix: wire PlatformDetector in ExecutableDetectorTest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ExecutableDetector uses @Inject for PlatformDetector, but tests instantiate it directly via 'new' — CDI doesn't run. Manually set the package-private 'platform' field in an instance initializer. --- src/test/java/com/dostalgia/ExecutableDetectorTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/com/dostalgia/ExecutableDetectorTest.java b/src/test/java/com/dostalgia/ExecutableDetectorTest.java index 58f1fe2..ced8efb 100644 --- a/src/test/java/com/dostalgia/ExecutableDetectorTest.java +++ b/src/test/java/com/dostalgia/ExecutableDetectorTest.java @@ -14,8 +14,14 @@ import static org.junit.jupiter.api.Assertions.assertTrue; class ExecutableDetectorTest { + private final PlatformDetector platform = new PlatformDetector(); private final ExecutableDetector detector = new ExecutableDetector(); + // Manually wire dependencies since we're not in a CDI container + { + detector.platform = platform; + } + @Test void findAll_findsExeComBat(@TempDir Path dir) throws Exception { Files.writeString(dir.resolve("GAME.EXE"), "MZ");