1.

What is the main difference between @Mock and @InjectMocks?

Answer»

@Mock annotation is USED for CREATING MOCKS whereas @InjectMocks is used for creating class OBJECTS. Whenever the actual method body has to be executed of a given class, then we can use @InjectMocks.



Discussion

No Comment Found