I am implementing automated tests of the system that consists of many microservices.
To verify appropriate behaviour of the endpoints using POST and PUT methods, I need to obtain some data (for example IDs) and set body or request headers using them.
I can obtain such data by: - calling appropriate endpoints using GET method, - obtaining IDs directly from the database.
Which of the mentioned ways is the most appropriate / the best practice? When I call GET to obtain data, I test also whether this endpoint works properly. On the other hand it is for sure slower than checking value directly in the DB.