We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Enabling out with generics for extension test().
out
test()
fun aMono(): Mono<out CharSequence> { return Mono.just("Hello") }
StepVerifier.create(aMono()) .expectNext( "Hello" // OK ) .verifyComplete()
aMono() .test() .expectNext( "Hello" // Compilation error ) .verifyComplete()
It can be good to accept generics. Maybe a modification like this can be added ?
Example of modification:
// ↓ add `out` fun <T> Flux<out T>.test(): StepVerifier.FirstStep<T> = StepVerifier.create(this)
StepVerifier.create(...)
StepVerifierExtensions
/** * Extension for testing [Flux] with [StepVerifier] API. * * @author Sebastien Deleuze */ fun <T> Flux<T>.test(): StepVerifier.FirstStep<T> = StepVerifier.create(this) /** * Extension for testing [Flux] with [StepVerifier] API. * * @author Sebastien Deleuze */ fun <T> Flux<T>.test(n: Long): StepVerifier.FirstStep<T> = StepVerifier.create(this, n) /** * Extension for testing [Flux] with [StepVerifier] API. * * @author Cristian Romero */ fun <T> Flux<T>.test(options: StepVerifierOptions): StepVerifier.FirstStep<T> = StepVerifier.create(this, options) /** * Extension for testing [Mono] with [StepVerifier] API. * * @author Sebastien Deleuze */ fun <T> Mono<T>.test(): StepVerifier.FirstStep<T> = StepVerifier.create(this) /** * Extension for testing [Mono] with [StepVerifier] API. * * @author Sebastien Deleuze */ fun <T> Mono<T>.test(n: Long): StepVerifier.FirstStep<T> = StepVerifier.create(this, n) /** * Extension for testing [Mono] with [StepVerifier] API. * * @author Cristian Romero */ fun <T> Mono<T>.test(options: StepVerifierOptions): StepVerifier.FirstStep<T> = StepVerifier.create(this, options)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Motivation
Enabling
out
with generics for extensiontest()
.Desired solution
It can be good to accept generics. Maybe a modification like this can be added ?
Example of modification:
Considered alternatives
StepVerifier.create(...)
Additional context
StepVerifierExtensions
The text was updated successfully, but these errors were encountered: