Mockito.any() pass Interface with Generics

前端 未结 7 1196
我在风中等你
我在风中等你 2020-11-29 16:26

is it possible to pass the type of an interface with generics?

The interface:

public interface AsyncCallback

In my test me

相关标签:
7条回答
  • 2020-11-29 17:27

    Further to thSoft's answer putting the qualified call to any() in method meant I could remove the qualification since the return type allowed inference:

    private HashMap<String, String> anyStringStringHashMap() {
        return Matchers.any();
    }
    
    0 讨论(0)
提交回复
热议问题