I’m using @SpringBootTest for integration testing in Spring Boot, and I want to mock database calls without connecting to the real database. However, I want to skip scanning the database configuration file to ensure the tests don’t attempt real database connections. How to achieve this?
I have tried enableautoconfiguration, exclude, testconfiguration but nothing works
New contributor
Ritika garg is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.