1.自带通用的日志封装log4j2
首先,maven导入依赖坐标
org.apache.logging.log4j log4j-core2.14.1 org.apache.logging.log4j log4j-api2.14.1 org.apache.logging.log4j log4j-slf4j-impl2.14.1 test org.slf4j slf4j-api1.7.30
其次,创建log4j.xml配置文件
2.核心容器支持@Nullable注解
@Nullable注解可以用在方法上,属性上,参数上,表示可以为空
3.支持函数式风格GenericApplicationContext
//1.创建GenericApplicationContext对象
GenericApplicationContext context = new GenericApplicationContext();
//2.调用Context的方法注册
context.refresh(); //清空
//3.注册
context.registerBean("user",User.class,()->new User());
//4.获取在spring注册的对象
//context.getBean("全限定类名");
context.getBean("user");
4.支持整合Junit5
(1)整合Junit4
首先,导入依赖坐标
org.springframework spring-test5.3.9 test
@RunWith(SpringJunit4ClassRunner.class) :单元测试框架
@ContextConfiguration(“classpath:配置文件”):加载配置文件
(2)整合Junit5
@ExtendWith(SpringExtension.class)
@ContextConfiguration(“classpath:配置文件”):加载配置文件
或者使用复合注解
@SpringJunitConfig(locations="classpath:配置文件")



