test(inbound): HTTP-level InboundEmailController tests#28
Open
mpge wants to merge 1 commit intofeat/inbound-email-orchestrationfrom
Open
test(inbound): HTTP-level InboundEmailController tests#28mpge wants to merge 1 commit intofeat/inbound-email-orchestrationfrom
mpge wants to merge 1 commit intofeat/inbound-email-orchestrationfrom
Conversation
Mirrors the Go handler tests (escalated-go#34) at the .NET
controller layer. Instantiates the real InboundEmailController
with an in-memory EF Core DbContext, real TicketService + Router
+ Service, and the Postmark + Mailgun parsers — then exercises:
- NewTicket_ReturnsCreatedOutcome: new-sender path produces
outcome=creatednew + status=created + persisted Ticket.
- MatchedReply_ReturnsRepliedToExisting: canonical
<ticket-55@...> In-Reply-To routes to the pre-seeded ticket
and returns outcome=repliedtoexisting + replyId — no second
ticket created.
- Skipped_ReturnsSkipped: SNS subscription confirmation is
skipped; DB unchanged.
- MissingSecret_Returns401 / BadSecret_Returns401: signature
guard rejects both no-header and wrong-header cases.
- UnknownAdapter_Returns400: dispatch guard.
Closes the same "service built but HTTP boundary untested" gap
that Go had; .NET's controller was already wired correctly via
#26 but had no HTTP-level coverage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mirrors the Go handler tests (escalated-go#34) at the .NET controller layer. The .NET inbound controller was already correctly wired via #26, but had no HTTP-level test coverage — this PR closes that gap.
What's tested
Instantiates the real `InboundEmailController` with:
Six cases:
Stacked PR
Based on `feat/inbound-email-orchestration` (#26) so the service + outcome enum are available. Merge order: #23 → #24 → #25 → #26 → this PR.
Test plan