Mocked private method with PowerMock, but underlying method still gets called

前端 未结 5 1300
暗喜
暗喜 2020-12-14 07:50

I am trying to mock out a private method that is making a JNDI call. When that method gets called from a unit test, it throws an exception^. I would like to mock-out that me

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-14 07:58

    when you use spy to construct a mock object, its a real half backed object. My guess would be to get rid of spy. Work on pure mock object.

提交回复
热议问题