Created
April 16, 2016 12:41
-
-
Save khajavi/d229fbd293fdfe4e44243d056f35da7b to your computer and use it in GitHub Desktop.
Test spy mockito
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class DataRepo { | |
| def getData = 5 | |
| } | |
| class MockWithInjectionTest extends FunSuite { | |
| @Spy var repo: DataRepo = _ | |
| test("spy") { | |
| MockitoAnnotations.initMocks(this) | |
| Mockito.when(repo.getData).thenReturn(8) | |
| assert(repo.getData == 8) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment