Have you seen my article on using Spring for managing test environments in automated tests?

Read all about how to configure your test environment specific data in property files with Spring, to help run your automated TestNG and JUnit tests on any test environment you need: https://blog.testproject.io/2021/02/09/using-spring-to-switch-environments-in-automated-tests/. Enjoy.