@Test public void fetchProfile() { ProfileOperations profileOperations = Mockito.mock(ProfileOperations.class); Mockito.when(xing.profileOperations()).thenReturn(profileOperations); Mockito.when(profileOperations.getUserProfile()).thenReturn(new XingProfile("50A3nOf73z", "Johannes", "Bühler", "https: UserProfile profile = apiAdapter.fetchUserProfile(xing); assertEquals("Johannes Bühler", profile.getName()); assertEquals("Johannes", profile.getFirstName()); assertEquals("Bühler", profile.getLastName()); assertEquals("johannesbuehler@oderbruecke.de",profile.getEmail()); assertNull(profile.getUsername()); }
public UserProfile fetchUserProfile(Xing xing) { XingProfile profile = xing.profileOperations().getUserProfile(); return new UserProfileBuilder() .setName(profile.getFirstName() + " " + profile.getLastName()) .setEmail(profile.getActiveEmail()).build(); }
XingAdapter implements ApiAdapter<Xing> { public UserProfile fetchUserProfile(Xing xing) { XingProfile profile = xing.profileOperations().getUserProfile(); return new UserProfileBuilder() .setName(profile.getFirstName() + " " + profile.getLastName()) .setEmail(profile.getActiveEmail()).build(); } }
XingAdapter implements ApiAdapter<Xing> { public UserProfile fetchUserProfile(Xing xing) { XingProfile profile = xing.profileOperations().getUserProfile(); return new UserProfileBuilder() .setName(profile.getFirstName() + " " + profile.getLastName()) .setEmail(profile.getActiveEmail()).build(); }  }
XingAdapter implements ApiAdapter<Xing> { public UserProfile fetchUserProfile(Xing xing) { XingProfile profile = xing.profileOperations().getUserProfile(); return new UserProfileBuilder() .setName(profile.getFirstName() + " " + profile.getLastName()) .setEmail(profile.getActiveEmail()).build(); }  boolean test(Xing xing); void setConnectionValues(Xing xing, ConnectionValues values); UserProfile fetchUserProfile(Xing xing); void updateStatus(Xing xing, String message); }
XingAdapter implements ApiAdapter<Xing> { public UserProfile fetchUserProfile(Xing xing) { XingProfile profile = xing.profileOperations().getUserProfile(); return new UserProfileBuilder() .setName(profile.getFirstName() + " " + profile.getLastName()) .setEmail(profile.getActiveEmail()).build(); }  boolean test(Xing xing); void setConnectionValues(Xing xing, ConnectionValues values); UserProfile fetchUserProfile(Xing xing); void updateStatus(Xing xing, String message);  }