You can better isolate the functionality you want to test by limiting the context of loaded frameworks/components. Often, it is sufficient to use the JUnit unit testing framework. without loading any additional frameworks. To accomplish this, you only need to annotate your test with @Test.
In the very naive code snippet below, there are no database interactions, and MapRepository loads data from the classpath.
https://tanzu.vmware.com/developer/guides/spring-boot-testing/