I want to mock a method with signature as:
public <T> T documentToPojo(Document mongoDoc, Class<T> clazz)
I mock it as below:
Mockito.when(mongoUtil.documentToPojo(Mockito.any(Document.class), Mockito.any(WorkItemDTO.class)))
But I get error as:
The method documentToPojo(Document, Class) in the type MongoUtil is not applicable for the arguments (Document, WorkItemDTO)
Is there any method in Mockito which will help me mock for T?
Aucun commentaire:
Enregistrer un commentaire