Mock the function without return value such the exit