@Override
  public File getScannerEngine() {
    File scannerDir = new File(fs.getHomeDir(), "lib/scanner");
    if (!scannerDir.exists()) {
      throw new NotFoundException(format("Scanner directory not found: %s", scannerDir.getAbsolutePath()));
    }
    return listFiles(scannerDir, VISIBLE, directoryFileFilter())
      .stream()
      .filter(file -> file.getName().endsWith(".jar"))
      .findFirst()
      .orElseThrow(() -> new NotFoundException(format("Scanner JAR not found in directory: %s", scannerDir.getAbsolutePath())));
  }
@Test
  void getScannerEngineMetadata_shouldFail_whenHashComputingFailed() {
    ScannerEngineHandlerImpl spy = spy(new ScannerEngineHandlerImpl(serverFileSystem));
    doReturn(new File("no-file")).when(spy).getScannerEngine();
    assertThatThrownBy(spy::getScannerEngineMetadata)
      .isInstanceOf(UncheckedIOException.class)
      .hasMessageContaining("Unable to compute SHA-256 checksum of the Scanner Engine");
  }