我有BaseUnitTest,看起来像这样
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"/applicationContext-test.xml"})
@Transactional
public abstract class BaseInitUser {
我的实际测试类扩展了这一切,一切正常。除了intellij突出显示bean注入错误,即使它确实有效:
但是当我添加指定上下文配置的annoation子类时,错误消失了:
@ContextConfiguration(locations = {"/applicationContext-test.xml"})
public class RegistrationControllerTest extends BaseInitUser {