Mockito Programming Model

From NovaOrdis Knowledge Base
Revision as of 03:31, 16 July 2021 by Ovidiu (talk | contribs) (→‎API)
Jump to navigation Jump to search

Internal

Overview

API

<syntaxhighlight lang='java'> import static org.mockito.Mockito.mock;

public class SomeClassTest {

 private ExternalDependency mockExternalDependency;
 @Before
 public void setUp() {
   mockExternalDependency = mock(ExternalDependency.class);
 }
 @Test
 public void someTest() throws Exception {
   ...
 }

}

Annotations