Commit 015318c
GH-1683 - Return persisted status from JpaEventPublicationAdapter.getStatus().
Previously, the JPA adapter derived the status from `completionDate` alone, returning either COMPLETED or PUBLISHED. As a result, publications that were marked FAILED (or RESUBMITTED) by `markFailed` / `markResubmitted` — both of which already write the correct value into the `status` column — appear as PUBLISHED when read back through `getStatus()`.
Mirror the JdbcEventPublicationRepositoryV2 adapter: return the persisted `status` when set, falling back to the previous derivation (with PROCESSING as the default, matching the JPA entity's own constructor) when older rows have a null status column.
The added integration test demonstrates the bug — without the fix it returns PUBLISHED after `markFailed` — and clears the persistence context between the JPQL update and the re-read so the test loads a fresh entity.
Signed-off-by: BK202503 <199436087+BK202503@users.noreply.github.com>
Original pull request: GH-1714.1 parent 976e936 commit 015318c
2 files changed
Lines changed: 26 additions & 1 deletion
File tree
- spring-modulith-events/spring-modulith-events-jpa/src
- main/java/org/springframework/modulith/events/jpa
- test/java/org/springframework/modulith/events/jpa
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
620 | | - | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
621 | 626 | | |
622 | 627 | | |
623 | 628 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
451 | 471 | | |
452 | 472 | | |
453 | 473 | | |
| |||
0 commit comments