Yes.. that does work for the first example, but not in the thenThrow
example.
Map<String, String> map = mock(Map.class);
when(map.get(anyString())).thenThrow(new
IllegalArgumentException("I don't know that string"));
when(map.get("abcd")).thenReturn("defg");
when(map.get("defg")).thenReturn("ghij");
When creating the second stub, the IllegalArgumentException from the
anyString() stub is thrown.
Alex
On Nov 18, 3:47 pm, Kristofer Karlsson <
kristofer.karls...@gmail.com>
wrote:
> >
mockito+u...@googlegroups.com<
mockito%2Bunsu...@googlegroups.com >
> > .