Mockito Programming Model: Difference between revisions
Jump to navigation
Jump to search
(→API) |
|||
Line 3: | Line 3: | ||
=Overview= | =Overview= | ||
=API= | =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= | =Annotations= |
Revision as of 03:31, 16 July 2021
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 { ... }
}