Modify test case with Mock

Use the mock library to simplify the process of test