Skip to content

test: fix OfficialNeteaseClient argument order in CloudMetadataCacheTest - #9

Open
PicoHug wants to merge 1 commit into
ColdP:mainfrom
PicoHug:fix/cloud-metadata-cache-test-args
Open

PicoHug wants to merge 1 commit into
ColdP:mainfrom
PicoHug:fix/cloud-metadata-cache-test-args

Conversation

@PicoHug

@PicoHug PicoHug commented Dec 2, 2026

Copy link
Copy Markdown

What

:app:testDebugUnitTest does not compile on main right now:

e: app/src/test/java/btm/m/auraplayer/data/CloudMetadataCacheTest.kt:86:91
   Argument type mismatch: actual type is 'CloudMetadataCache', but 'String' was expected.

OfficialNeteaseClient is (cookie, client, webOrigin, streamOrigin, eapiOrigin, clientlogOrigin, clientlog3Origin, metadataCache), but this test still passes the cache as the 5th positional argument, so it lands on eapiOrigin. Looks like it was left behind when the extra origin parameters were added in ff00e1d.

Passing it as metadataCache = ... fixes the compile error and also keeps the call valid if more origin parameters get added later. One line, test-only, no production code touched.

Result

After this change :app:testDebugUnitTest compiles again — that is the whole scope of this PR.

Note that 6 tests still fail once the suite runs (JDK 23, 344 tests). I am not touching them here, because it is not obvious whether the code or the expectations are out of date and that call is better made by you:

  • AuraAudioProcessorTest.antiClippingTamesInterSampleOversInBypassWhileLeavingNormalSignalsUntouched — java.nio.BufferUnderflowException
  • CloudMetadataCacheTest.boundedCacheEvictsAndSelectiveInvalidationKeepsOtherPlaylists — expected null, was {"id":1}
  • CloudMetadataCacheTest.repeatedPagesUseDiskButRefreshAndDifferentAccountsUseNetwork — expected 2, was 1
  • OfficialNeteaseClientTest.requestsPlaybackAtOfficialEapiWithoutPuttingSessionInUrl — expected /eapi/song/enhance/pl..., was /weapi/song/enhance/pl...
  • OfficialNeteaseClientTest.musicDetailUsesEapiFirstAndFallsBackToWeapiWhenEmpty — AssertionError
  • QqMusicApiTest.customAndOfficialArtistAlbumsAndTrackListsClassifyConsistently — expected a y.qq.com/music/photo_new/... cover URL, was empty

The two OfficialNeteaseClientTest failures look like the eapi-first behaviour changed without the expectations following; the CloudMetadataCacheTest ones look like eviction/account-keying semantics moved. Worth a look when you have time — with JDK 17 another 8 tests also fail on UnsupportedClassVersionError, so JDK 21+ is needed to see the real picture.

`OfficialNeteaseClient` gained `eapiOrigin` and `clientlogOrigin` /
`clientlog3Origin` between `streamOrigin` and `metadataCache`, so the
positional `CloudMetadataCache` argument in this test no longer matches
any parameter and `:app:testDebugUnitTest` fails to compile on main:

  Argument type mismatch: actual type is 'CloudMetadataCache',
  but 'String' was expected.

Pass it as a named argument so the call survives further origin
parameters being added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant