Fixed NPEs in using mocks tests