First of all I would say that there is no “correct” solution.

The solution that I suggest here is based on my personal experience working on many different projects.

Don’t expect to find here a “silver bullet” for all cases.

You can call any framework “correct” if the framework

  1. allows you to create any scenario for the target services that should be covered
  2. allows to create tests that are readable and maintanable.
  3. generates the logs that include all requests/responses and allow you to debug test failures quickly.

Hopefully, it helps some of you to make the first steps and create your Test Automation Framework for your current project.

TechStack

The typical stack for most of my projects: Java Spring Boot TestNG/Junit Maven Git Jenkins

I assume that you work in the similar one.

You can find the source code that is used as an example here - Demo Test Framework for REST API