Files
music-metadata-system/src/test/resources/audio-fixtures/README.md

1.0 KiB
Raw Blame History

Test audio fixture guidance

The current unit tests avoid committing real audio binaries and instead use byte[] plus a mocked AudioTagExtractor.

Recommended real-file fixtures if you later want integration tests:

  1. valid-square-cover.flac

    • Tags: title, artist, album_artist, album, track=01/12
    • Embedded PNG cover 320x320
    • UTF-8 encoded text
  2. missing-cover.mp3

    • Same core tags as above
    • No embedded artwork
    • Expected validator result: COVER_MISSING
  3. bad-track.m4a

    • Track stored as 1 instead of 01/12
    • Expected validator result: INVALID_FORMAT
  4. garbled-title.ogg

    • Title intentionally stored with broken encoding bytes so it decodes to Bad <20> Title
    • Expected reader encoding result: UNKNOWN

To generate those fixtures quickly, ffmpeg plus a tagging tool is enough:

ffmpeg -f lavfi -i sine=frequency=440:duration=1 -c:a flac valid.flac

Then embed tags and artwork with a dedicated tag editor, or continue mocking AudioTagExtractor in unit tests for faster coverage.