Mocking Logger and LoggerFactory with PowerMock and Mockito

前端 未结 5 1688
误落风尘
误落风尘 2020-12-01 02:38

I have the following Logger I want to mock out, but to validate log entries are getting called, not for the content.

private static Logger logger = 
                 


        
5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-01 03:11

    I think you can reset the invocations using Mockito.reset(mockLog). You should call this before every test, so inside @Before would be a good place.

提交回复
热议问题