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
When I use jmockit with SpringJUnit4ClassRunner, somehow createTest() is called twice. It causes initialization issue to some TestExecutionListener.
This is a example test case to reproduce this issue.
import mockit.Invocation; import mockit.Mock; import mockit.MockUp; import org.junit.Ignore; public class Test { @Ignore public static class BlockJUnit4ClassRunner { void createTest() { System.out.println("BlockJUnit4ClassRunner.createTest()"); } } @Ignore public static class SpringJUnit4ClassRunner extends BlockJUnit4ClassRunner { @Override void createTest() { System.out.println("SpringJUnit4ClassRunner.createTest()"); super.createTest(); } } public static class BlockJUnit4ClassRunnerDecorator extends MockUp<BlockJUnit4ClassRunner> { @Mock public void createTest(Invocation invocation){ System.out.println("BlockJUnit4ClassRunnerDecorator.createTest()"); invocation.proceed(); } } @org.junit.Test public void test() { new BlockJUnit4ClassRunnerDecorator(); new SpringJUnit4ClassRunner().createTest(); } }
output
SpringJUnit4ClassRunner.createTest() BlockJUnit4ClassRunnerDecorator.createTest() SpringJUnit4ClassRunner.createTest() BlockJUnit4ClassRunner.createTest()
The text was updated successfully, but these errors were encountered:
Thanks for the report.
Sorry, something went wrong.
1c66210
rliesenfeld
No branches or pull requests
When I use jmockit with SpringJUnit4ClassRunner, somehow createTest() is called twice. It causes initialization issue to some TestExecutionListener.
This is a example test case to reproduce this issue.
output
The text was updated successfully, but these errors were encountered: