fix: wire PlatformDetector in ExecutableDetectorTest
Build & Deploy / build-and-deploy (push) Successful in 38s
Build & Deploy / build-and-deploy (push) Successful in 38s
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.
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user