I use Spring boot and in ma aspect class i got two fields wich has @Autowired annotation. When I run code then it works fine but when i run test for this class then this two autowired fields are null. Can someone tell what I need to do to fix that? I'm sorry for lack of code but today I don't have access to this.
well, having in mind the fact that your question is not clear at all, here are some options that you could potentially miss in your test code:
PS please read and understand more about dependency injection (@Autowired) of Spring Boot applications
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.