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

Powermock #365

Closed
nnar1o opened this issue Sep 18, 2018 · 7 comments
Closed

Powermock #365

nnar1o opened this issue Sep 18, 2018 · 7 comments
Milestone

Comments

@nnar1o
Copy link

nnar1o commented Sep 18, 2018

When I try to create test using powermock (class annotated with @RunWith(PowerMockRunner.class))
Jgiven logging does not work and json report is not generated

@ahus1
Copy link
Contributor

ahus1 commented Sep 18, 2018

Could you please publish a minimal example (as a github repository) that shows the problem? This would help to investigate what's going wrong.

@nnar1o
Copy link
Author

nnar1o commented Sep 18, 2018

@janschaefer
Copy link
Contributor

Thanks for the example. I can confirm that it is not working.

@janschaefer
Copy link
Contributor

Ok. It seems to be a bug in the PowerMockRunner as it does not execute JUnit Class Rules, which is required by JGiven. See powermock/powermock#687 for a possible workaround. This cannot be fixed in JGiven, sorry!

@janschaefer
Copy link
Contributor

I reopen the issue, because the mentioned workaround of adding @PowerMockRunnerDelegate( BlockJUnit4ClassRunner.class ) is also not working. The workaround enables Class Rules again, but due to some other PowerMock behavior it is not working either.

@janschaefer janschaefer added bug and removed wontfix labels Sep 22, 2018
@janschaefer janschaefer added this to the v0.16.1 milestone Sep 22, 2018
@janschaefer
Copy link
Contributor

Issue will be fixed with v0.16.1 and the mentioned workaround.

@f3mshep
Copy link

f3mshep commented Oct 15, 2018

I was able to resolve this issue by annotating the test class with the following:
@RunWith(PowerMockRunner.class) @PowerMockRunnerDelegate(BlockJUnit4ClassRunner.class)

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

No branches or pull requests

4 participants