@Test public void testShouldSucceedWhenApiCanRetrieveUserProfile() { UserOperations userOperations = mock(UserOperations.class); when(yammer.userOperations()).thenReturn(userOperations); YammerProfile yammerProfile = mock(YammerProfile.class); when(userOperations.getUserProfile()).thenReturn(yammerProfile); boolean isApiOK = apiAdapter.test(yammer); assertTrue(isApiOK); }
public boolean test(Yammer yammer) { try { yammer.userOperations().getUserProfile(); return true; } catch (RestClientException e) { return false; } }
YammerAdapter implements ApiAdapter<Yammer> { public boolean test(Yammer yammer) { try { yammer.userOperations().getUserProfile(); return true; } catch (RestClientException e) { return false; } } }
YammerAdapter implements ApiAdapter<Yammer> { public boolean test(Yammer yammer) { try { yammer.userOperations().getUserProfile(); return true; } catch (RestClientException e) { return false; } }  }
YammerAdapter implements ApiAdapter<Yammer> { public boolean test(Yammer yammer) { try { yammer.userOperations().getUserProfile(); return true; } catch (RestClientException e) { return false; } }  boolean test(Yammer yammer); void setConnectionValues(Yammer yammer, ConnectionValues values); UserProfile fetchUserProfile(Yammer yammer); void updateStatus(Yammer yammer, String message); }
YammerAdapter implements ApiAdapter<Yammer> { public boolean test(Yammer yammer) { try { yammer.userOperations().getUserProfile(); return true; } catch (RestClientException e) { return false; } }  boolean test(Yammer yammer); void setConnectionValues(Yammer yammer, ConnectionValues values); UserProfile fetchUserProfile(Yammer yammer); void updateStatus(Yammer yammer, String message); static final String EMAIL_PRIMARY_TYPE; }