mercredi 19 février 2020

How to verify if method of interface is called

I would like to test if a method from an interface is called. For example, I would like to verify that "map.put(A,B)" is called like in the below code. How would I do this in Junit? Would I need to use Mockito?


  public void funcName() {
    Map<String, Object> map = new HashMap<>();
    map.put("VALUE", new Object());
    ...
  }

Aucun commentaire:

Enregistrer un commentaire