Model natives/classifiers/extract on Library, download the matching
native classifier jar and unpack it into versions/<id>/natives so
pre-1.13 versions can launch. Cached client jar, libraries and assets
are now checked against their recorded size and sha1 instead of a bare
exists(), and fresh client jar downloads are verified before use.
Closes the "zero production touches" subset of the deferred coverage
items the audit had flagged.
- src/tui/widgets/popups/new_instance/render.rs: three new snapshots
for the Version, LoaderVersion, and Confirm steps. Each pre-populates
WIZARD_STATE so ensure_versions_loaded and ensure_loader_versions_loaded
short-circuit on LoadState::Loaded and never spawn a network task. The
TEST_SERIAL mutex established in the earlier batch serialises against
the existing Name/Loader snapshots.
- src/tui/widgets/popups/import_modpack/render.rs: two new snapshots
for the Version step (synthetic VersionInfo entries) and the Confirm
step (synthetic ImportSummary). Same serialisation pattern.
- tests/net_mojang.rs: three new wiremock tests.
download_libraries_writes_artifact_to_meta_dir constructs a synthetic
VersionMeta whose single library points at the wiremock server, then
asserts the bytes land at meta_dir/libraries/<artifact.path>.
download_libraries_skips_when_destination_exists verifies the cache
hit path via wiremock's expect(0).
download_assets_writes_index_when_objects_is_empty exercises the
index fetch+write code path with an empty objects map so the per-asset
download loop never fires.
Zero production touches. download_libraries already takes a
VersionMeta whose libraries carry their own URLs; download_assets'
index fetch reads from meta.asset_index.url (also configurable
per-call), so the empty-objects path doesn't need ASSETS_BASE_URL
overridable. Full per-asset coverage lands in a separate commit.
The existing fetch_version_manifest hard-codes the Mojang URL, so tests
either had to hit the live endpoint (the #[ignore] live-API test) or
not run at all. Adds fetch_version_manifest_from(client, url) that lets
callers pick the URL; fetch_version_manifest stays compatible by
delegating with the upstream constant. fetch_version_meta_with_raw
already takes the URL via VersionEntry, no change needed.
tests/net_mojang.rs adds three wiremock tests:
- fetch_version_manifest_parses_synthetic_response verifies the
VersionManifest deserialiser against a synthetic upstream-shaped
payload (latest + versions list).
- fetch_version_meta_returns_struct_and_raw_bytes verifies both the
parsed VersionMeta and the raw byte capture path used by the install
flow to write upstream JSON byte-for-byte.
- fetch_version_manifest_retries_5xx_and_succeeds confirms the retry
envelope integrates correctly with VersionManifest deserialisation
on top of the retry-only tests in tests/net_retry.rs.
These don't replace the #[ignore = "hits live Mojang API"] canary
which still runs on master push to detect upstream schema drift.