lundi 29 mars 2021

how to captor a hashmap inside a nested method in Mockito?

The class and its methods as follows.

Class MyClass{
   method1(){
      method2(para1)
   }

   method2(para1){
      HashMap<String,String> users=new HashMap<>();
      ...
      para1.setUsers(users)
   }
}

I want to captor the users hashmap for unit testings by mocking the MyClass. How I can complete this with mockito?

Aucun commentaire:

Enregistrer un commentaire