Skip to content
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

Fix IMessageExtractor technical debts in tests #7099

Merged

Conversation

Arkatufus
Copy link
Contributor

Changes

  • Convert all usage of ExtractEntityId and ExtractShardId delegates in unit tests to IMessageExtractor interface implementation.
  • Improve NRE message caused by IMessageExtractor.EntityMessage() returning a null.
    • We can convert this into an Akka.Analyzer error rule.

Copy link
Contributor Author

@Arkatufus Arkatufus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self-review

Comment on lines +1823 to +1824
if (payload is null)
throw new ArgumentNullException($"IMessageExtractor.EntityMessage() should never return null. Message extractor: {_extractor.GetType()}");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"IMessageExtractor.EntityMessage() should never return null" message is much better than an obscure null reference exception being thrown later on in this method when we try to access the payload variable.

Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Aaronontheweb Aaronontheweb merged commit f7ed2ac into akkadotnet:dev Feb 16, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants