Created
December 1, 2020 07:49
-
-
Save frekele/cbb9c1e6daf9507a5d449d1c32908a8c to your computer and use it in GitHub Desktop.
This file contains 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
public class MockitoTest { | |
@Mock | |
MyDatabase databaseMock; | |
@Rule public MockitoRule mockitoRule = MockitoJUnit.rule(); | |
@Test | |
public void testQuery() { | |
ClassToTest t = new ClassToTest(databaseMock); | |
boolean check = t.query("* from t"); | |
assertTrue(check); | |
verify(databaseMock).query("* from t"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment