How can the classes of Java Mock not all the classes used by Mock in Mock,?

the project environment is a SpringBoot project, and the type is injected with @ Autowired. I just want to Mock some of the classes and I don"t want to deal with all of Mock.
1. You can inject Mock classes using InjectMocks, but if one of them has multiple interfaces, after tagging InjectMocks, the other dependent interfaces become null, is there a solution?

@ InjectMocks
private An a;

@ Mock
private B b;

if the three services B and CMagie D are dependent on in A, I will cause the C Personality D in A to be null,. Is there a separate way to inject it? The classes in
2 and @ Spy must be implementation classes, but the ones defined in spring are interface types, and many RPC services are injected through @ Autowired, so there is no implementation class at all. How can this be used without Mock dropping?

Jan.25,2022
Menu