Return Types of Mocked Activities for Errors

When mocking, what type of error should be returned? ApplicationError or any error will do? I know that returning an error will get put into the ApplicationError, but is that standard practice for testing?

For the real activity, should an ApplicationError always be returned in an activity? Or is that only in cases where changes in retry behavior might be required?

When mocking, what type of error should be returned?

I would return the same error that you expect your normal activity implementation to return.

For the real activity, should an ApplicationError always be returned in an activity? Or is that only in cases where changes in retry behavior might be required?

Any error is converted to the ApplicationError. So you want to return ApplicationError if you want to include additional information into it as details. Also, you can create a nonretryable ApplicationError which can be useful in some cases.