If I understood correctly, the app is updating the last_active_at time for the agent, and the API which is updating is failing with the error message you have attached. Because the API is not going into a success case, the code coverage is not going above 80% and you are reaching out to ask how this case is to ensure 80% and above code coverage.
Can you tell me which API this is and what else the app is intended to solve?
The time will be dependent on the customer that has installed the app. With a minimum of one month, however customers can also check the box so that the app only deletes tickets and requesters and doesnt search for agents at all.
So the question is; how to fake the data (on a read only field) so that we can get an agent to delete in order to get higher code coverage?