Cover the chat-routing propagation that broke assignLoanOfficer

TestSecurityService
Shipped
August 6, 2026 at 8:56 PM UTC
Author
Kamo
Commit
1e59b9f

assignLoanOfficer gained a step that looks up the loan's source lead to reroute the borrower's open public-chat session. That lookup runs a JPQL query through the service's EntityManager, which is @PersistenceContext field-injected and so absent from the constructor this unit test builds the service with — the test NPE'd on a null em from the moment the branch landed, untested. Wire em the way Spring does and cover the branch itself: routes to the new officer for a portal-sourced loan, publishes nothing for a hand-entered loan with no source lead, and publishes nothing when the assignment is cleared.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing