單元測(cè)試無(wú)法注入對(duì)象
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.example.springboot.service.GirlServiceTest': Unsatisfied dependency expressed through field 'girlService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.example.springboot.service.GirlService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
2019-04-24
老鐵,解決了沒(méi)有呀?
2017-12-09
可能是GirlService類或者實(shí)現(xiàn)類,沒(méi)加@Service注解