#117: DataTransferJCRCleanUpJobTest.kt

plugins/org.projectforge.plugins.datatransfer/src/test/kotlin/org/projectforge/plugins/datatransfer/DataTransferJCRCleanUpJobTest.kt Path: plugins/...datatransfer/src/test/kotlin/.../DataTransferJCRCleanUpJobTest.kt · Lines: 100 · Type: Kotlin JUnit 5 integration test 100 lines · 65 code · 22 comments · 13 blank

Integration test for DataTransferJCRCleanUpJob — the scheduled job that deletes files whose expiry date has passed. Tests file lifecycle: create → expire → verify deletion. Uses JCR test repository via initJCRTestRepo(MODUL_NAME, "cleanUpTestRepo").

Test flow

  1. Sets up test user with an area configured with expiryDays
  2. Uploads test files to the area via JCR RepoService
  3. Simulates time passing — sets file creation dates in the past beyond the expiry threshold
  4. Runs DataTransferJCRCleanUpJob.execute()
  5. Verifies expired files are removed from JCR and attachments_counter decremented
  6. Verifies non-expired files remain untouched

Key dependencies