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?
And I’m assuming that this is a Serverless app that is triggered by a scheduled event. Which would use the list agents API to get the agents and compare the last_active_at timestamp.
And for testing, you would need agents who have an old date for last_active_at. Based on the error from the update agent API, last_active_at is not a supported field.
Can you confirm if the app you are building is for Freshservice?
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?