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

Add Refaster template for StepVerifier#create to use Fluent API #18

Merged
merged 3 commits into from
Nov 14, 2021

Conversation

rickie
Copy link
Member

@rickie rickie commented Oct 28, 2021

No description provided.

@rickie rickie requested a review from Stephan202 October 28, 2021 12:07
@@ -59,6 +59,10 @@
return ImmutableSet.of(PublisherProbe.of(Mono.empty()), PublisherProbe.of(Flux.empty()));
}

ImmutableSet<StepVerifier.FirstStep<Integer>> testStepVerifierCreate() {
Copy link
Member Author

Choose a reason for hiding this comment

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

Wasn't too sure whether it would be better to split the test, such that the test better reflects the two templates. WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

I'd indeed split the test in two. Makes finding the respective test easier.

Copy link
Member

Choose a reason for hiding this comment

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

We could also combine the templates (though that's slightly... juck). We do try to have one test method for each template, so yes, let's split.

@@ -194,6 +194,32 @@ private ReactorTemplates() {}
}
}

/** Use the fluent API style when using {@link StepVerifier#create} for {@link Mono}. */
static final class StepVerifierCreateMono<T> {
Copy link
Member Author

Choose a reason for hiding this comment

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

Had a "hacky" idea, where I combined the two Refaster templates in one template.
So that one before template has Flux<T> and the other Mono<T> with the same aftertemplate.
It is somewhat of workaround, but I had to try.

Copy link
Member

Choose a reason for hiding this comment

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

Yep, was pondering the same (see my comment below ;) ), but this might bite us if we ever want to statically validate the "sanity" of a given template. So fine to leave as-is.

@rickie rickie requested a review from hisener November 8, 2021 12:43
@rickie rickie requested a review from werli November 10, 2021 08:21
Copy link
Member

@werli werli left a comment

Choose a reason for hiding this comment

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

Overall LGTM

I'm trusting you on the last point. 👍

@@ -59,6 +59,10 @@
return ImmutableSet.of(PublisherProbe.of(Mono.empty()), PublisherProbe.of(Flux.empty()));
}

ImmutableSet<StepVerifier.FirstStep<Integer>> testStepVerifierCreate() {
Copy link
Member

Choose a reason for hiding this comment

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

I'd indeed split the test in two. Makes finding the respective test easier.

@Stephan202 Stephan202 force-pushed the rossendrijver/step_verifier_create branch from 55de1e9 to 30c6647 Compare November 14, 2021 12:40
Copy link
Member

@Stephan202 Stephan202 left a comment

Choose a reason for hiding this comment

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

Rebased and added a few tweaks.

Suggested commit message:

Add Refaster rules for `StepVerifier` creation (#18)

@@ -59,6 +59,10 @@
return ImmutableSet.of(PublisherProbe.of(Mono.empty()), PublisherProbe.of(Flux.empty()));
}

ImmutableSet<StepVerifier.FirstStep<Integer>> testStepVerifierCreate() {
Copy link
Member

Choose a reason for hiding this comment

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

We could also combine the templates (though that's slightly... juck). We do try to have one test method for each template, so yes, let's split.

@@ -194,6 +194,32 @@ private ReactorTemplates() {}
}
}

/** Use the fluent API style when using {@link StepVerifier#create} for {@link Mono}. */
static final class StepVerifierCreateMono<T> {
Copy link
Member

Choose a reason for hiding this comment

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

Yep, was pondering the same (see my comment below ;) ), but this might bite us if we ever want to statically validate the "sanity" of a given template. So fine to leave as-is.

@Stephan202 Stephan202 merged commit 26a9b46 into master Nov 14, 2021
@Stephan202 Stephan202 deleted the rossendrijver/step_verifier_create branch November 14, 2021 12:48
@Stephan202 Stephan202 added this to the 0.1.0 milestone Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants