Java @TestExecutionListeners似乎禁用了自动连接或上下文加载

Java @TestExecutionListeners似乎禁用了自动连接或上下文加载,java,spring,spring-test,Java,Spring,Spring Test,以下是简单的代码: ListenerTest.java,入口 package learn.spring.test; 导入learn.spring.model.Person; 导入org.junit.jupiter.api.Test; 导入org.junit.jupiter.api.extension.extensedWith; 导入org.springframework.beans.factory.annotation.Autowired; 导入org.springframework.test.

以下是简单的代码:

ListenerTest.java,入口

package learn.spring.test;
导入learn.spring.model.Person;
导入org.junit.jupiter.api.Test;
导入org.junit.jupiter.api.extension.extensedWith;
导入org.springframework.beans.factory.annotation.Autowired;
导入org.springframework.test.context.ContextConfiguration;
导入org.springframework.test.context.TestExecutionListeners;
导入org.springframework.test.context.junit.jupiter.SpringExtension;
导入静态org.junit.jupiter.api.Assertions.assertNotNull;
@ExtendWith(SpringExtension.class)
@ContextConfiguration(类=SimpleConfig.class)
//@TestExecutionListeners(MyTestExecutionListener.class)
公共类监听器测试{
@自动连线
个人;
@试验
公共空间基本(){
资产不为空(人);
}
}
package learn.spring.test;
导入learn.spring.model.Person;
导入org.springframework.context.annotation.Bean;
导入org.springframework.context.annotation.Configuration;
@配置
公共类SimpleConfig{
@豆子
公众人物{
归还新人(“瑞克”);
}
}
package learn.spring.test;
导入lombok.extern.slf4j.slf4j;
导入org.springframework.test.context.TestContext;
导入org.springframework.test.context.TestExecutionListener;
@Slf4j
公共类MyTestExecutionListener实现TestExecutionListener{
@凌驾
公共void beforeTestExecution(TestContext TestContext)引发异常{
log.info(“在{}之前”,testContext.getTestMethod());
}
}
Person
是一个非常简单的POJO,应该安全地省略

注释了
@TestExecutionListeners
后,测试将通过。但是,
assertNotNull(person)将失败

似乎某种程度上,
@TestExecutionListeners
禁用了自动布线。我做错了什么