-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add default headers to TestableMessageHandlerContext #427
Comments
@SimonCropp can you give me any more detail about what you're looking for here? Are we talking about "emulating" NServiceBus so that when testing MessageA, that the result is that MessageB is sent/published with specific headers in relation to MessageA? That might work for some things like CorrelationId / ConversationId, but I'm concerned that for anything like TimeSent we'd require some form of time provider to be in play. Or are you looking for a method that would pre-fill the headers in the testable context (related to the incoming message) with some default valid-looking values? Or something else? I'm also struggling with how to provide anything like this in an opt-in format that wouldn't break a bunch of existing tests. We're already planning a minor release of the testing framework, so I'd love to figure out if this could ride along. |
many extension points to NSB make assumption about the existence of certain headers. For example we have an email endpoint that we attach nsb headers for debugging purposes
If the nsb test lib populated these with some hard coded (but different) guids. i would save use having to set these in tests. hard coded guids means tests that assert on these values could continue to work. note asserts on known guids would not effect us since we use guid scrubbing/replacement
I think TimeSent could be DateTime.now. can sill override their own value, and use a time provider if they want
perhaps a api to enable it that people can call in a module initializer |
Note this is the same as the approach you already use for MessageId and ReplyToAddress
although i would prefer MessageId to be hard coded |
Usage of
TestableMessageHandlerContext
would be easier (fewer lines of code to setup) if it would provide default header values for commonly used headers eg ConversationId and TimeSent etcThe text was updated successfully, but these errors were encountered: