-
Notifications
You must be signed in to change notification settings - Fork 37
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
Introduce Reactor MonoJustRepeatTakeOne Refaster rule #1253
base: master
Are you sure you want to change the base?
Conversation
Looks good. No mutations were possible for these changes. |
|
@@ -1727,6 +1727,19 @@ PublisherProbe<T> after() { | |||
} | |||
} | |||
|
|||
/** Prefer {@link Flux#just(Object)} over more verbose alternatives. */ | |||
static final class MonoJustRepeatTakeOne<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a undocumented rule about the naming of Refaster rules, we name them like the content of their after template. In this case that would clash with the already existing FluxJust
Refaster rule, didn't know that was already there.
That changes some things a little bit;
- We can move this rule up a bit to be together with that one. We should rename the other one then as that has a limitation that it only works for
Integer
s. - Didn't see this upfront, but I think we can combine the two rules into one! Let's take a look together tomorrow @tijana-ninkovic :).
@@ -584,6 +584,10 @@ ImmutableSet<PublisherProbe<Void>> testPublisherProbeEmpty() { | |||
return ImmutableSet.of(PublisherProbe.of(Mono.empty()), PublisherProbe.of(Flux.empty())); | |||
} | |||
|
|||
Flux<Integer> testMonoJustRepeatTakeOne() { | |||
return Mono.just(5).repeat().take(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Within each test, we usually start with value 0
and go up from there.
Summary
This PR introduces the
MonoJustRepeatTakeOne
rule, which replaces the following patternwith
Suggested Commit Message