I am making a web app using gradle. I used log4j in this app. When I build the project I am getting error...
I still did not find a good answer. And I forgot to say, My project build correctly and show log massages correctly. It doesn't work only on test classes.
Adding this annotation works for me.
@PowerMockIgnore("org.apache.log4j.*")
Your classpath contains 2 copies of log4j library. Exclude one and try again.
There is a Clear answer here. :D
When we have a final method and slf4j loggers in our classes. We have to use powermock in our test class. Because of this we have to use @MockPolicy(Slf4jMockPolicy.class) with particuler imports at the test class which we used Powermock.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With