@SpringBootApplication
public class SpringbootMockStarter {
public static void main(String[] args) {
SpringApplication.run(ConsumerTest.class, args);
}
}
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = SpringbootMockStarter.class)
@TestPropertySource("classpath:application.properties")
public class SpringbootMockSupport {
}
- 在springboot单元测试的基础上增加 Parameterized 支持
@RunWith(Parameterized.class)
public class ParameterizedSpringbootMockSupport extends SpringbootMockSupport {
@Before
public void setUp() throws Exception {
TestContextManager testContextManager = new TestContextManager(getClass());
testContextManager.prepareTestInstance(this);
}
}