java.lang.IllegalStateException: missing behavior definition for the preceding method call getMessage(“title”)

后端 未结 5 1789
礼貌的吻别
礼貌的吻别 2021-02-06 22:54

I\'m using EasyMock(version 2.4) and TestNG for writing UnitTest.

I have a following scenario and I cannot change the way class hierarchy is defined.

I\'m testin

5条回答
  •  孤城傲影
    2021-02-06 23:40

    For me, this exception was occurring because the method I was trying to stub was final (something I hadn't realized).

    If you want to stub a final method you'll need to use Powermock.

提交回复
热议问题