I have a Spring Boot application that exposes rest endpoints and stores data in a relational database.
For testing purposes I need to populate database with some test data. At what level should I write the code to populate the database. I favor using the rest endpoints to post data through my layers and into the database but this also seems a bit like overkill when I could just get a reference to the repositories and use that to insert the data. I could even just do raw SQL.
Which approach would be the most suitable and why.