You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gusega
changed the title
a "plain" unit test creates spring context if I run it together with a "Spring" test.
a "plain" unit test behaves like a spring test if I run it together with a "Spring" test.
Feb 14, 2025
gusega
changed the title
a "plain" unit test behaves like a spring test if I run it together with a "Spring" test.
a "plain" unit test behaves like a "Spring" test if I run it together with a "Spring" test.
Feb 14, 2025
If you would like us to be able to process this issue, please provide the requested information. If the information is not provided within the next 3 weeks, we will be unable to proceed and this issue will be closed.
Hello,
For my application I have a plain unit test and a test that uses "spring-test" in 2 separate test files in a single maven module
I annotate my unit test with
@ExtendWith(MockitoExtension.class)
and the test method itself with
@ExtendWith(OutputCaptureExtension.class)
I annotate my spring test with
@ExtendWith(SpringExtension.class)
If I run unit test alone, both in intellij and via maven, it runs as a "plain" unit test, as expected.
If I run both spring test and and junit test together, then my "plain" test becomes a spring test, which I don't expect.
The consequence of this is that plain unit test prints spring banner and logging picks up
logback-spring.xml
.My tests are using
Please let me know if you want me to provide additional information or a sample repository.
Thanks
The text was updated successfully, but these errors were encountered: