Ambiguous Method Call Mocking RestTemplate.exchange()

前端 未结 2 1758
甜味超标
甜味超标 2021-01-22 21:45

Can\'t figure out the correct way to use matchers to identify which overload of the exchange method I am targetting. The call I am making:

restTemplate.exchange(ur

2条回答
  •  误落风尘
    2021-01-22 22:10

    Most likely you are using the when().then() pattern.

    Try the doReturn().when() approach with your matchers.

    Just make sure you use matchers even for the params that you expect directly (use eq() for this).

    Here is the issue and fix on project issue tracker.

提交回复
热议问题