My Spring app has its own DB for persistence. The same app needs to send ad-hoc queries to external databases. Queries are provided by users.
- App takes SQL query provided by user
- App takes external database type (postgres / oracle / whatever jdbc)
- App submits adhoc query in runtime to external DB
- App returns result as json to user
Is there any way to utilize spring test containers in order to test this functionaly? My goal is:
- Write tests for every supported DB
- each test starts test container with supported DB (some subset of these I suppose: https://www.testcontainers.org/modules/databases/)
- each test uploads sample data to container DB
- each test runs set of "must work" queries against it.
I see many examples where App itself is tested against test containers, but can I just start container w/o plugging it as App persistence DB?