Java - Mockito: Difference between revisions

From My Limbic Wiki
(Page créée avec « =Annotations= * '''@Mock''': Mock an object. Doesn't allow to contact real methods implementations * '''@InjectMocks''': Inject others mocks declared in the same test into... »)
 
(No difference)

Latest revision as of 00:10, 29 November 2019

Annotations

  • @Mock: Mock an object. Doesn't allow to contact real methods implementations
  • @InjectMocks: Inject others mocks declared in the same test into this mock
  • @Spy: Mock an object. Allow to contact real methods implementations
  • @Captor: avoid warnings related capturing complex generic types.