How to verify multiple method calls with different params

前端 未结 7 1673
自闭症患者
自闭症患者 2020-12-13 08:14

I have the following method that I wish to verify behaviour on.

public void methodToTest(Exception e, ActionErrors errors) {
    ...

    errors.add("exc         


        
相关标签:
7条回答
  • 2020-12-13 08:40

    Try something like this:

    verify(errors, times(2))
         .add(AdditionalMatchers.or(eq("exception.message"), eq("exception.detail")),
              any(ActionError.class));
    
    0 讨论(0)
提交回复
热议问题