Last active
July 27, 2016 13:17
-
-
Save Dalamar42/2866df212f17560cd8f8948a524e375b 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
// This is the stub generated by our fictional framework | |
Database stubDatabase = stub(Database.class); | |
// Class that we want to test and that uses stubDatabase | |
ApplicationService service = new ApplicationService(stubDatabase); | |
// Here we are telling the stub what to return | |
when(stubDatabase.getApplicationKey(APP_ID)) | |
.thenReturn(new ApplicationKey(APP_ID, Status.REVOKED)); | |
// Test ApplicationService behaviour | |
assertThat(service.isRevoked(APP_ID), is(true)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment