Fix exceptions
Fix tests

Use Mockito