mockito ArrayList<String> problem...

Posted by Sardathrion on Stack Overflow See other posts from Stack Overflow or by Sardathrion
Published on 2010-05-27T15:09:18Z Indexed on 2010/05/27 15:21 UTC
Read the original article Hit count: 280

Filed under:
|
|
|

I have a method that I am trying to unit test. This method takes a parameter as an ArrayList and does things with it. The mock I am trying to define is:

ArrayList<String> mocked = mock(ArrayList.class);

which gives a [unchecked] unchecked conversion" warning.

ArrayList<String> mocked = mock(ArrayList<String>.class);

gives me an error.

Anyone care to enlighten me as to what I am doing wrong?

© Stack Overflow or respective owner

Related posts about java

Related posts about arraylist