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
Context is not propagated in Junit5 nested class #1417
Comments
Ok, solved. You need to add |
False alarm, it made things even worse... |
Hi @eximius313, Thanks for your report! I tried to run the code you provided but I did not observe any test failure, both are passing. Could you please provide more information about your environment? Thank you! |
Hi @bsideup , thanks for your response. We use spring-test 5.1.0.RELEASE and spring-boot-test:2.1.0.M4 The nested test fails with reason: |
@anilewek does it also fail if you update to the release version of spring-boot-test (2.1.0.RELEASE)? |
@bsideup yes, it still fails with the same error. |
Ok, I was able to reproduce it, but only when Meanwhile, I'll check with Spring Security folks why it happens. |
I confim (I have it as transitive dependency) |
Ok, Reproduced with: @ExtendWith(SpringExtension.class)
class ContextTest {
@Test
void testContext() {
StepVerifierOptions stepVerifierOptions = StepVerifierOptions.create()
.withInitialContext(Context.of("foo", "bar"));
StepVerifier.create(Mono.just(1), stepVerifierOptions)
.expectAccessibleContext()
.contains("foo", "bar")
.then()
.verifyComplete();
}
} it works if you annotate test class with @eximius313 @anilewek it also means that you can temporary workaround the bug by annotating your nested class with |
Thanks |
Hi @eximius313, Was about to follow up :) I think we were able to identify the problem and the fix will be included in the next release. Thanks! |
I can confirm that the error does not occur with version 3.2.3 |
Expected behavior
Both tests pass
Actual behavior
Only test in main class pass
Steps to reproduce
Run the test:
Reactor Core version
3.2.0.RELEASE
JVM version (e.g.
java -version
)9.0.4
The text was updated successfully, but these errors were encountered: