Closed naviud closed 3 months ago
Hi @naviud thank you creating this ticket and nice to see that developers actually are giving the examples a try. That example should work, so I find it strange that it is not working for you. I added a test case which is exactly running the example which you mentioned, see here: https://github.com/Hakky54/log-captor/pull/99
And it is passing. So it is probably not related to logcapture, but maybe to something else... Is your Junit 5 dependency correctly defined? Or are you using something else to have a similar structure?
Maybe you can create a small POC repository at your github profile, so we can have a look at it together, what do you think?
I am closing this ticket as the issue you mentioned is not happening as shown here: https://github.com/Hakky54/log-captor/pull/99
The tests are passing with the setup you mentioned. So I am assuming it is related to your local dev environment or ide setup. If you still have the issue, I am willing to help you out. You can create a private repo at github and add me as collaborator which will give the the possibility to invesitgate and test it on my side
Describe the bug As mentioned in README, I tried to create a private static LogCaptor variable and initialized from a method annotated with @BeforeAll. So the method should be a static ofc. With that approach, looks like logs are not captured.
But this works perfectly with non static way.
To Reproduce
Expected behavior Way mentioned above is the elegant way. I believe, it should work in that way as well.
Environmental Data:
Additional context N/A