Skip to content

Instantly share code, notes, and snippets.

@bopbi
Created May 19, 2019 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bopbi/f5988366de3f542f85bbddf4d6f30dc4 to your computer and use it in GitHub Desktop.
Save bopbi/f5988366de3f542f85bbddf4d6f30dc4 to your computer and use it in GitHub Desktop.
Mock Recipe
mock runnable
java:
doAnswer(invocation -> {
final Runnable test = (Runnable) invocation.getArguments()[0];
test.run();
return null;
}).when(mockedDaoSession).runInTx(any());
kotlin:
whenever(mockedDaoSession.runInTx(any())).thenAnswer {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment