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

Test for Mono.never() is ineffective #52

Closed
dclarke18 opened this issue Oct 10, 2018 · 1 comment · Fixed by #67
Closed

Test for Mono.never() is ineffective #52

dclarke18 opened this issue Oct 10, 2018 · 1 comment · Fixed by #67

Comments

@dclarke18
Copy link

dclarke18 commented Oct 10, 2018

lite-rx-api-hands-on/src/test/java/io/pivotal/literx/Part02MonoTest.java
includes the test method below which passes even with my change so is ineffective.
Should the test be changed to register a doOnNext(fail())? Should StepVerifier have a better way of checking nothing produced from the Flux/Mono for a period?

@Test
	public void noSignal() {
		//Mono<String> mono = workshop.monoWithNoSignal();
                 Mono<String> mono = Mono.just("ShouldFail");
		StepVerifier
				.create(mono)
				.expectSubscription()
				.expectNoEvent(Duration.ofSeconds(1))
				.thenCancel()
				.verify();
	}  
@PyvesB
Copy link
Contributor

PyvesB commented Oct 23, 2019

Same issue here. I believe this is a bug in reactor-core's step verifiers, I raised the following issue to flag this up: reactor/reactor-core#1913

In the meantime, the following test replacement is a workaround (i.e. it will fail as expected for Mono.just("ShouldFail")):

@Test
public void noSignal() {
    Mono<String> mono = workshop.monoWithNoSignal();
    StepVerifier.create(mono.timeout(Duration.ofSeconds(1L)))
            .verifyError(TimeoutException.class);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants