Created
July 27, 2016 13:14
-
-
Save Dalamar42/6aec9b3b09fbc4a12b13f9fff84b5e79 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 fake we create | |
Database fakeDatabase = new Database() { | |
Map<Long, ApplicationKey> applications = Maps.newHashMap( | |
APP_ID, new ApplicationKey(APP_ID, Status.REVOKED) | |
); | |
@Override | |
public ApplicationKey getApplicationKey(Long id) { | |
return applications.get(id); | |
} | |
} | |
// Class that we want to test and that uses fakeDatabase | |
ApplicationService service = new ApplicationService(fakeDatabase); | |
// 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