我正在尝试进行集成测试,包括执行ApplicationRunner。
我使用@SpringBootTest,并且在初始化上下文后,会自动启动ApplicationRunner,这没关系。
我想要实现的是在ApplicationRunner中注入一个模拟并在执行ApplicationRunner之前配置该模拟。
如果我在测试中配置模拟,那是行不通的,因为在执行测试时,Spring上下文已经初始化并且ApplicationRunner已经执行。
是否有一种方法可以配置模拟<> Spring上下文已经初始化,并且之前执行了ApplicationRunner?
我正在尝试进行集成测试,其中包括执行ApplicationRunner。我使用@SpringBootTest,并且在初始化上下文时,将自动启动ApplicationRunner,...