samedi 3 octobre 2015

How to use injectMocks for collection if I have mock of collection elements?

I have following class to test:

public class UsersHolder {
    private Set<User> users = new HashSet<>();
   ///
}

inside test class I write:

@Spy
private UsersHolder usersHolder = new UsersHolder();

But I have not ideas how to inject mock of User into list inside UserHolder.

Aucun commentaire:

Enregistrer un commentaire