Mockito

1.@injectmocks can only be annotated on the implementation class?

2. I would like to ask, one of my implementation classes called a lot of different services, using spring annotation injection, if I only want to mock individual services, what should I do? now after using @ injectmocks annotation, other services in the implementation class are null, can not use spring injection.

some people on the Internet say that if you annotate the implementation class with injectmocks and autowird together, you can try it, but it won"t work.

Mar.23,2021

I don't know if SpringBoot is used
if so, just MockBean to do the injection

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b34cbe-2bf49.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b34cbe-2bf49.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?