Adding configuration class to SpringBootTest breaks component scan

后端 未结 2 1606
既然无缘
既然无缘 2021-01-19 12:47

I am trying to disable real Mongo connection and replace it with Fongo mock in tests.

Here is my test class:



        
2条回答
  •  不思量自难忘°
    2021-01-19 12:57

    try use

    • @SpringBootTest @Import(value = TestConfig.class)

    instead of @SpringBootTest(classes = TestConfig.class)

提交回复
热议问题