Avoid deprecation notice in mock object