You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reactor's PublisherProbe defines a neat API to test reactive code. However, it is only helpful when it is actually used.
Considering the following code snippet, the PublisherProbe is initialized and asserted, but never actually used. Surely we can assert that it was never subscribed to, because we never included it in code that should be subscribed to. 🙂
@TestvoidprobeBugChecker() {
PublisherProbe<Void> probe = PublisherProbe.empty();
// some test code that doesn't involve `probe`probe.assertWasNotSubscribed();
}
This looks like an unintentional human mistake that wrongfully could increase the author's confidence in their production code.
Description of the proposed new feature
Support a stylistic preference.
Avoid a common gotcha, or potential problem.
Improve performance.
I'd like to have a BugChecker that identifies such a construct as a common mistake and expects changes.
Considerations
In essence, this BugChecker should flag in the following scenario:
A PublisherProbe is declared and initialized
Is used exclusively in assertion calls (e.g. PublisherProbe#assertWasNotSubscribed).
The BugChecker should not flag if
The PublisherProbe is used
as a mocked value with PublisherProbe#{mono,flux}
as a parameter to a method, since it could be used for mocking there
Participation
I am willing to submit a pull request to implement this improvement.
Most likely not within the next couple of weeks.
The text was updated successfully, but these errors were encountered:
Problem
Reactor's
PublisherProbe
defines a neat API to test reactive code. However, it is only helpful when it is actually used.Considering the following code snippet, the
PublisherProbe
is initialized and asserted, but never actually used. Surely we can assert that it was never subscribed to, because we never included it in code that should be subscribed to. 🙂This looks like an unintentional human mistake that wrongfully could increase the author's confidence in their production code.
Description of the proposed new feature
I'd like to have a BugChecker that identifies such a construct as a common mistake and expects changes.
Considerations
In essence, this BugChecker should flag in the following scenario:
PublisherProbe
is declared and initializedPublisherProbe#assertWasNotSubscribed
).The BugChecker should not flag if
PublisherProbe
is usedPublisherProbe#{mono,flux}
Participation
Most likely not within the next couple of weeks.
The text was updated successfully, but these errors were encountered: