kamiazya/scopes

fix: resolve FileBasedUserPreferencesRepository test failures

Offen

#220 geöffnet am 12.09.2025

 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Kotlin (3 Forks)auto 404
good first issuehacktoberfest

Repository-Metriken

Stars
 (2 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Problem

Three tests in FileBasedUserPreferencesRepositoryTest are failing due to implementation bugs in the repository:

Failing Tests

  1. should fail when aggregate has no preferences (line 198)

    • Expected: PreferencesNotInitialized error
    • Actual: InvalidPreferenceValue with ULID validation error
  2. should load valid preferences from file successfully (line 275)

    • Expected: Fixed timestamp 2022-01-01T00:00:00Z
    • Actual: Current system timestamp
  3. should handle permission errors when writing file (line 447)

    • Expected: Graceful error handling
    • Actual: AccessDeniedException during repository construction

Root Causes

  • ULID validation logic issues in preference value handling
  • Timestamp overwriting during file deserialization
  • Missing error handling in repository constructor for filesystem permissions

Impact

  • Tests fail in CI/CD pipeline
  • Temporarily excluded from JaCoCo coverage to unblock CI integration
  • No impact on actual functionality (tests are overly strict)

Acceptance Criteria

  • Fix ULID validation for preference values
  • Preserve timestamps during file loading operations
  • Add proper error handling for filesystem permission issues in constructor
  • All 34 tests in infrastructure module should pass
  • Re-enable JaCoCo coverage for this module

Priority

Medium - Does not block current development but should be addressed to maintain test coverage and code quality.

Contributor Guide