importorg.junit.Test; importorg.junit.runner.RunWith; importorg.springframework.beans.factory.annotation.Autowired; importorg.springframework.boot.test.context.SpringBootTest; importorg.springframework.test.context.junit4.SpringRunner; @SpringBootTest(classes = SpringbootLearnApplication.class) @RunWith(S...
第二步,在SpringBoot的配置类中开启AspectJ代理 @SpringBootApplication@EnableAspectJAutoProxy(proxyTargetClass=true)publicclassSpringbootLearnApplication{publicstaticvoidmain(String[]args){SpringApplication.run(SpringbootLearnApplication.class,args);}} 第三步,写代码 创建一个目标类 /*** 教师类*/@Componentpubl...