Mockito Programming Model: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 5: Line 5:
<syntaxhighlight lang='java'>
<syntaxhighlight lang='java'>
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.mock;
import com.example.ExternalDependency;


public class SomeClassTest {
public class SomeClassTest {
Line 21: Line 22:
}
}
</syntaxhighlight>
</syntaxhighlight>
=Annotations=
=Annotations=

Revision as of 03:32, 16 July 2021

Internal

Overview

API

import static org.mockito.Mockito.mock;
import com.example.ExternalDependency;

public class SomeClassTest {

  private ExternalDependency mockExternalDependency;

  @Before
  public void setUp() {
    mockExternalDependency = mock(ExternalDependency.class);
  }

  @Test
  public void someTest() throws Exception {
    ...
  }
}

Annotations