且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

春季启动测试:无法实例化内部配置类

更新时间:2022-06-19 22:35:49

任何嵌套配置类都必须声明为静态.因此您的代码应为:

Any nested configuration classes must be declared as static. So your code should be :

@Configuration
static class TestConfiguration{

    @Bean
    public InterviewInformationDao getInterviewInformationDao(){
        return new InterviewInformationDaoImpl();
    }
}