refactored tests into more extensive use of mockito