I have the following code:
@Component
public class Wrapper
{
@Resource
private List strategies;
public String getName(String
Mockito can not know that you want to put somthing in the List strategies.
You should rethink this an do something like this
@InjectMocks
private Wrapper testedObject = new Wrapper ();
private List mockedStrategies;
@Mock
StrategyA strategyA;
@Mock
StrategyB strategyB;
@Before
public void setup() throws Exception {
mockedStrategies = Arrays.asList(strategyA, strategyB);
wrapper.setStrategies(mockedStrategies);
}