ocarlsen / mock-slf4j-impl

SLF4J implementation with mock Loggers backed by Mockito.
MIT License
2 stars 1 forks source link

jUnit Extension to clean logger mocks #7

Open vitalijr2 opened 1 month ago

vitalijr2 commented 1 month ago

I have implemented a similar plugin to the platform loggers.

It uses the same way to create loggers and have same side effects: if loggers are re-used in other tests then a tester-developer should clean invocations manually by Mockito.clearInvocations(*). I have added an extension that does that small work before and after tests.

How about adding similar extension to mock-slf4j-impl?

ocarlsen commented 1 month ago

Hi Vitalij,

Sure. Could you please file an issue https://github.com/ocarlsen/mock-slf4j-impl/issues/new/choose with the project and I will take a look at it.

Cheers, O

On Tue, Aug 20, 2024 at 8:38 AM Vitalij Berdinskih @.***> wrote:

I have implemented a similar plugin to the platform loggers https://github.com/vitalijr2/mock-jdk-platform-logging.

It uses the same way to create loggers and have same side effects: if loggers are re-used in other tests then a tester-developer should clean invocations manually by Mockito.clearInvocations(*). I have added an extension that does that small work before and after tests.

How about adding similar extension to mock-slf4j-impl?

— Reply to this email directly, view it on GitHub https://github.com/ocarlsen/mock-slf4j-impl/issues/7, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASDNUJQGT66TJ4HGLCEL2DZSNPI7AVCNFSM6AAAAABM2FU5QOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ3TKOJWGE4DONY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

vitalijr2 commented 5 days ago

Hi Owen, I added PR with a jUnit Extension. Looks like the workflows misses SONAR's environment variables. On my box the building is OK.

ocarlsen commented 5 days ago

Thanks. Not sure why SonarCloud is failing, I'll check it out.

On Mon, Sep 23, 2024 at 11:39 AM Vitalij Berdinskih < @.***> wrote:

Hi Owen, I added PR with a jUnit Extension. Looks like the workflows misses SONAR's environment variables. On my box the building is OK.

— Reply to this email directly, view it on GitHub https://github.com/ocarlsen/mock-slf4j-impl/issues/7#issuecomment-2369076807, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASDNUIF5YATRNXJSC5GG53ZYBN57AVCNFSM6AAAAABM2FU5QOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRZGA3TMOBQG4 . You are receiving this because you commented.Message ID: @.***>

vitalijr2 commented 4 days ago

@ocarlsen i found the mention of this issue: it's a feature for some security reasons.

ocarlsen commented 4 days ago

Awesome, thanks @vitalijr2. Could you please follow the recommendation:

  1. create a feature branch
  2. merge your changes into that
  3. then make a pull request?

That will trigger the workflow with credentials.