According to the documentation (https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.docker-compose), Spring boot execute docker compose up when application starts and docker compose stop when application is shutdown. It works very well when the main method is called.
But it does not work with tests (@SpringBootTest). This forces to execute the docker command manually on a terminal window. If it is intentional the documentation could explain why.