fix(test): lucky draw history test fails between 00:00 and 02:00 #51

Merged
ngqile merged 1 commits from fix-luckydraw-test-clock into main 2026-12-02 07:06:10 +00:00
Owner

EventControllerLuckyDrawTest.historyReturnsRowsNewestFirst… placed its two receipts one and two hours before now. The controller lists only receipts from today, counted from local midnight. That behaviour is intended and stays as it is. Between 00:00 and 02:00 the test's receipts fell on yesterday, so the history came back empty.

Fix

The fix is in the test only: the two receipts now sit at 00:01 and 00:02 today. The production code does not change. The assertions are unchanged.

Verification

  • Before the fix: run with -Duser.timezone=Etc/GMT+7, where local time was 00:02, the test fails with Expected size: 2 but was: 0.
  • After the fix: it passes at 00:02 (Etc/GMT+7) and at the current time (Asia/Kuala_Lumpur).
  • mvn -T 1C -pl solvway-mobile-api -am verify passes.

No OpenSpec change is needed, because no behaviour changes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs

`EventControllerLuckyDrawTest.historyReturnsRowsNewestFirst…` placed its two receipts one and two hours before now. The controller lists only receipts from today, counted from local midnight. That behaviour is intended and stays as it is. Between 00:00 and 02:00 the test's receipts fell on yesterday, so the history came back empty. ## Fix The fix is in the test only: the two receipts now sit at 00:01 and 00:02 today. The production code does not change. The assertions are unchanged. ## Verification - **Before the fix:** run with `-Duser.timezone=Etc/GMT+7`, where local time was 00:02, the test fails with `Expected size: 2 but was: 0`. - **After the fix:** it passes at 00:02 (`Etc/GMT+7`) and at the current time (`Asia/Kuala_Lumpur`). - `mvn -T 1C -pl solvway-mobile-api -am verify` passes. No OpenSpec change is needed, because no behaviour changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
ngqile added 1 commit 2026-12-02 07:06:06 +00:00
The history test placed receipts one and two hours before now, so
between 00:00 and 02:00 they fell on yesterday and the controller's
today filter dropped them. Pin them to just after midnight instead.
Reproduced with -Duser.timezone=Etc/GMT+7 at 00:02 local time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
ngqile merged commit 8efa160797 into main 2026-12-02 07:06:10 +00:00
ngqile deleted branch fix-luckydraw-test-clock 2026-12-02 07:06:10 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ngqile/co-lite#51