Modified test to use mocks