mar*_*ush 7 junit spring annotations
有没有人知道如何解决这个问题.
@RunWith(SpringJUnit4ClassRunner.class)
@RunWith(Parametrized.class)
@ContextConfiguration("/META-INF/blah-spring-test.xml")
public class BlahTest
..
Run Code Online (Sandbox Code Playgroud)
所以我想要进行弹簧性测试,同时希望对其进行参数化以避免代码重复...
正如评论文章中所述,您不能使用两个跑步者。您应该Parameterized像使用 Spring 的TestContextManager一样使用运行器来加载 Spring 上下文。
@Before
public void before() throws Exception {
new TestContextManager(getClass()).prepareTestInstance(this);
}
Run Code Online (Sandbox Code Playgroud)