Slide 83
Slide 83 text
Mocking the Retrofit interface
Canned data
/** A mock implementation of the {@link GitHub} API interface. */
static class MockGitHub implements GitHub {
private final Map>> ownerRepoContributors;
public MockGitHub() {
ownerRepoContributors = new LinkedHashMap>>();
// Seed some mock data.
addContributor("square", "retrofit", "John Doe", 12);
addContributor("square", "retrofit", "Bob Smith", 2);
addContributor("square", "retrofit", "Big Bird", 40);
addContributor("square", "picasso", "Proposition Joe", 39);
addContributor("square", "picasso", "Keiser Soze", 152);
}