@Test public void getEmails() throws Exception { mockServer.expect(requestTo("https: .andRespond( withSuccess(new ClassPathResource("listEmails.json", getClass()), MediaType.APPLICATION_JSON)); List<Email> emailList = usersTemplate.listEmails(); Assertions.assertThat(emailList).isNotNull(); Assertions.assertThat(emailList.size()).isEqualTo(1); }
@Override public List<Email> listEmails() { return Arrays .asList(getRestOperations().getForEntity(buildUriString(USER_EMAILS_PATH), Email[].class).getBody()); }
UsersTemplate extends AbstractGithubTemplate implements UsersOperations { @Override public List<Email> listEmails() { return Arrays .asList(getRestOperations().getForEntity(buildUriString(USER_EMAILS_PATH), Email[].class).getBody()); } }
UsersTemplate extends AbstractGithubTemplate implements UsersOperations { @Override public List<Email> listEmails() { return Arrays .asList(getRestOperations().getForEntity(buildUriString(USER_EMAILS_PATH), Email[].class).getBody()); } UsersTemplate(RestOperations restOperations); }
UsersTemplate extends AbstractGithubTemplate implements UsersOperations { @Override public List<Email> listEmails() { return Arrays .asList(getRestOperations().getForEntity(buildUriString(USER_EMAILS_PATH), Email[].class).getBody()); } UsersTemplate(RestOperations restOperations); @Override List<Email> listEmails(); @Override List<Email> addEmails(String... emails); @Override List<Email> addEmails(List<String> emails); @Override void deleteEmails(String... emails); @Override void deleteEmails(List<String> emails); @Override List<PubKey> listPublicKeys(String username); @Override List<ExtPubKey> listPublicKeys(); @Override ExtPubKey getPublicKey(long id); @Override ExtPubKey createPublicKey(PubKeyInput pubKey); @Override void deletePublicKey(long id); }
UsersTemplate extends AbstractGithubTemplate implements UsersOperations { @Override public List<Email> listEmails() { return Arrays .asList(getRestOperations().getForEntity(buildUriString(USER_EMAILS_PATH), Email[].class).getBody()); } UsersTemplate(RestOperations restOperations); @Override List<Email> listEmails(); @Override List<Email> addEmails(String... emails); @Override List<Email> addEmails(List<String> emails); @Override void deleteEmails(String... emails); @Override void deleteEmails(List<String> emails); @Override List<PubKey> listPublicKeys(String username); @Override List<ExtPubKey> listPublicKeys(); @Override ExtPubKey getPublicKey(long id); @Override ExtPubKey createPublicKey(PubKeyInput pubKey); @Override void deletePublicKey(long id); static final String USER_EMAILS_PATH; }