refactor test case to remove mock object