There is a type-safe way: use ArgumentMatchers.any()
and qualify it with the type:
ArgumentMatchers.<AsyncCallback<ResponseX>>any()
More Related Contents:
- Using Mockito to mock classes with generic parameters
- mocking a method that return generics with wildcard using mockito
- Difference between
- Java Generics (Wildcards)
- Java generics super keyword
- Java Enum definition
- What does the question mark in Java generics’ type parameter mean? [duplicate]
- @RunWith(MockitoJUnitRunner.class) vs MockitoAnnotations.initMocks(this)
- Using Mockito with multiple calls to the same method with the same arguments
- How to tell a Mockito mock object to return something different the next time it is called?
- Generic type parameter naming convention for Java (with multiple chars)?
- Implement converters for entities with Java Generics
- LambdaConversionException with generics: JVM bug?
- Why does this generic code compile in java 8?
- Mockito: Mock private field initialization
- Why shouldn’t Java enum literals be able to have generic type parameters?
- Mockito verify order / sequence of method calls
- Java: Casting from List to List when B implements A?
- PowerMock, mock a static method, THEN call real methods on all other statics
- Create a List of primitive int?
- Bug in eclipse compiler or in javac (“type parameters of T cannot be determined”)
- Why are my mocked methods not calld when executing a unit test?
- Java collections covariance problem
- Get type name for generic parameter of generic class [duplicate]
- Unbounded wildcards in Java
- What do < and > mean such as implements Comparable?
- Consumer mapped Class in HashMap
- Java generics, Unbound wildcards vs
- How to reference a generic return type with multiple bounds
- How to mock a builder with mockito