Task 4-2: Integration Test - Listener Recovery
Phase: 4 - Testing Priority: Medium Depends on: Không có Reference:
docs/BountyHunter-Backend/details/feature-batch-async-processing/SPEC.md
Background
Test JMSListenerRecoveryScheduler phát hiện và khôi phục listener đã stop.
Test scenarios
Recovery detection
- [ ] Force stop 1 listener container (simulate crash)
- [ ] Wait for
JMSListenerRecoverySchedulertick - [ ] Verify listener được start lại (log:
[RECOVERY] Recovered listener: {id}) - [ ] Send message sau recovery → listener nhận và xử lý
No false positive
- [ ] Tất cả listeners running → scheduler không log recovery
- [ ] Scheduler không tự stop running listeners
Recovery metrics
- [ ] Count số lần recovery xảy ra → log/metric để monitor stability
Verification / Acceptance Criteria
- [ ] Test class exists at
batch/test/.../JMSListenerRecoveryTest.javaand passes in CI - [ ] Recovery scenario: forced-stopped container is detected and restarted by
JMSListenerRecoverySchedulerwithin one scheduler tick; log contains[RECOVERY] Recovered listener: <containerId> - [ ] Post-recovery message consumption: a message sent to the previously stopped queue is successfully processed after recovery
- [ ] No false positive: all-healthy scenario produces zero
Recovered listenerlog lines - [ ] No accidental stop: no running container transitions to
isRunning() == falseas a side effect of the scheduler