As part of my efforts to
create more concise Unit Tests in Java, Steve McLarnon and I recently added the ability to create a stub and stub one method with only one line.
The implementation relies entirely on Mockito, so my example assumes you were already using Mockito to create the stub.
The Mockito documentation has the following example for stubbing:LinkedList mockedList = mock(LinkedList.class);
when(mockedList.get(0)).thenReturn("first");Using the code Steve and I put together you can...
Published on February 24, 2010 05:30