Added mockito.
Refactor some tests to use mockito.