spy and mock for simple testcase