@Test public void fetchProfile() { AthleteOperations athleteOperations = Mockito.mock(AthleteOperations.class); when(strava.athleteOperations()).thenReturn(athleteOperations); when(athleteOperations.getAthleteProfile()).thenReturn(createProfile(123456L, "Craig", "Walls", "cwalls@example.com", "http: UserProfile profile = apiAdapter.fetchUserProfile(strava); assertEquals("Craig Walls", profile.getName()); assertEquals("cwalls@example.com", profile.getEmail()); assertEquals("cwalls@example.com", profile.getUsername()); }
public UserProfile fetchUserProfile(Strava strava) { StravaAthleteProfile profile = strava.athleteOperations().getAthleteProfile(); return new UserProfileBuilder().setName(profile.getName()).setEmail(profile.getEmail()).setUsername(profile.getEmail()).build(); }
StravaAdapter implements ApiAdapter<Strava> { public UserProfile fetchUserProfile(Strava strava) { StravaAthleteProfile profile = strava.athleteOperations().getAthleteProfile(); return new UserProfileBuilder().setName(profile.getName()).setEmail(profile.getEmail()).setUsername(profile.getEmail()).build(); } }
StravaAdapter implements ApiAdapter<Strava> { public UserProfile fetchUserProfile(Strava strava) { StravaAthleteProfile profile = strava.athleteOperations().getAthleteProfile(); return new UserProfileBuilder().setName(profile.getName()).setEmail(profile.getEmail()).setUsername(profile.getEmail()).build(); }  }
StravaAdapter implements ApiAdapter<Strava> { public UserProfile fetchUserProfile(Strava strava) { StravaAthleteProfile profile = strava.athleteOperations().getAthleteProfile(); return new UserProfileBuilder().setName(profile.getName()).setEmail(profile.getEmail()).setUsername(profile.getEmail()).build(); }  boolean test(Strava strava); void setConnectionValues(Strava strava, ConnectionValues values); UserProfile fetchUserProfile(Strava strava); void updateStatus(Strava strava, String message); }
StravaAdapter implements ApiAdapter<Strava> { public UserProfile fetchUserProfile(Strava strava) { StravaAthleteProfile profile = strava.athleteOperations().getAthleteProfile(); return new UserProfileBuilder().setName(profile.getName()).setEmail(profile.getEmail()).setUsername(profile.getEmail()).build(); }  boolean test(Strava strava); void setConnectionValues(Strava strava, ConnectionValues values); UserProfile fetchUserProfile(Strava strava); void updateStatus(Strava strava, String message);  }