Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moving the project to the root

  • Loading branch information...
commit 97ba706a7f729bca8b314239dd5f6ceefee3ee7c 1 parent f63d538
@Treydone authored
Showing with 0 additions and 6,876 deletions.
  1. +0 −15 spring-social-viadeo/.classpath
  2. +0 −36 spring-social-viadeo/.project
  3. +0 −9 spring-social-viadeo/.settings/org.eclipse.jdt.core.prefs
  4. +0 −7 spring-social-viadeo/.settings/org.eclipse.wst.common.component
  5. +0 −5 spring-social-viadeo/.settings/org.eclipse.wst.common.project.facet.core.xml
  6. +0 −8 spring-social-viadeo/.settings/org.maven.ide.eclipse.prefs
  7. +0 −181 spring-social-viadeo/pom.xml
  8. +0 −3  spring-social-viadeo/src/META-INF/MANIFEST.MF
  9. +0 −3  spring-social-viadeo/src/main/java/META-INF/MANIFEST.MF
  10. +0 −26 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/Career.java
  11. +0 −48 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/Comment.java
  12. +0 −92 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/ContactCards.java
  13. +0 −66 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/Experience.java
  14. +0 −20 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/GraphAPIException.java
  15. +0 −96 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/Job.java
  16. +0 −24 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/JobOperations.java
  17. +0 −67 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/News.java
  18. +0 −69 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/Phone.java
  19. +0 −97 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/UserOperations.java
  20. +0 −16 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/Viadeo.java
  21. +0 −118 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/ViadeoProfile.java
  22. +0 −77 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/AbstractViadeoOperations.java
  23. +0 −26 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/Comments.java
  24. +0 −28 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/Contacts.java
  25. +0 −25 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/Feed.java
  26. +0 −27 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/JobTemplate.java
  27. +0 −27 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/JobsResult.java
  28. +0 −106 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/UserTemplate.java
  29. +0 −103 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/ViadeoTemplate.java
  30. +0 −24 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/VisitCards.java
  31. +0 −19 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/CareerMixin.java
  32. +0 −20 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/CommentMixin.java
  33. +0 −19 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/CommentsMixin.java
  34. +0 −41 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/ContactCardsMixin.java
  35. +0 −21 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/ContactsMixin.java
  36. +0 −22 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/ExperienceMixin.java
  37. +0 −21 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/FeedMixin.java
  38. +0 −36 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/JobMixin.java
  39. +0 −17 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/JobsResultMixin.java
  40. +0 −29 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/NewsMixin.java
  41. +0 −20 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/PhoneMixin.java
  42. +0 −51 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/ViadeoModule.java
  43. +0 −34 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/ViadeoProfileMixin.java
  44. +0 −19 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/VisitCardsMixin.java
  45. +0 −43 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/connect/ViadeoAdapter.java
  46. +0 −13 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/connect/ViadeoConnectionFactory.java
  47. +0 −46 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/connect/ViadeoOAuth2Template.java
  48. +0 −20 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/connect/ViadeoServiceProvider.java
  49. +0 −7 spring-social-viadeo/src/main/resources/log4j.properties
  50. +0 −34 spring-social-viadeo/src/test/java/org/springframework/social/viadeo/api/impl/AbstractViadeoApiTest.java
  51. +0 −51 spring-social-viadeo/src/test/java/org/springframework/social/viadeo/api/impl/JobTemplateTest.java
  52. +0 −289 spring-social-viadeo/src/test/java/org/springframework/social/viadeo/api/impl/UserTemplateTest.java
  53. +0 −82 spring-social-viadeo/src/test/java/org/springframework/social/viadeo/api/impl/testdata/career-for-id.json
  54. +0 −82 spring-social-viadeo/src/test/java/org/springframework/social/viadeo/api/impl/testdata/career-for-me.json
  55. +0 −58 ...g-social-viadeo/src/test/java/org/springframework/social/viadeo/api/impl/testdata/contact-cards-for-id.json
  56. +0 −58 ...g-social-viadeo/src/test/java/org/springframework/social/viadeo/api/impl/testdata/contact-cards-for-me.json
  57. +0 −28 spring-social-viadeo/src/test/java/org/springframework/social/viadeo/api/impl/testdata/detailled-job.json
  58. +0 −653 ...g-social-viadeo/src/test/java/org/springframework/social/viadeo/api/impl/testdata/full-contacts-for-id.json
  59. +0 −653 ...g-social-viadeo/src/test/java/org/springframework/social/viadeo/api/impl/testdata/full-contacts-for-me.json
  60. +0 −480 ...ial-viadeo/src/test/java/org/springframework/social/viadeo/api/impl/testdata/full-home_newsfeed-for-id.json
  61. +0 −480 ...ial-viadeo/src/test/java/org/springframework/social/viadeo/api/impl/testdata/full-home_newsfeed-for-me.json
  62. +0 −28 spring-social-viadeo/src/test/java/org/springframework/social/viadeo/api/impl/testdata/full-profile-by-id.json
  63. +0 −28 spring-social-viadeo/src/test/java/org/springframework/social/viadeo/api/impl/testdata/full-profile-me.json
  64. +0 −364 spring-social-viadeo/src/test/java/org/springframework/social/viadeo/api/impl/testdata/job-search.json
  65. +0 −1,464 spring-social-viadeo/src/test/java/org/springframework/social/viadeo/api/impl/testdata/search-contacts.json
  66. +0 −97 spring-social-viadeo/src/test/java/org/springframework/social/viadeo/connect/TestViadeoApiAdapter.java
View
15 spring-social-viadeo/.classpath
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
- <attributes>
- <attribute name="org.eclipse.jst.component.nondependency" value=""/>
- </attributes>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
View
36 spring-social-viadeo/.project
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>spring-social-viadeo</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.common.project.facet.core.builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.validation.validationbuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
- <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
View
9 spring-social-viadeo/.settings/org.eclipse.jdt.core.prefs
@@ -1,9 +0,0 @@
-#Sun Sep 11 18:58:01 CEST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.source=1.6
View
7 spring-social-viadeo/.settings/org.eclipse.wst.common.component
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project-modules id="moduleCoreId" project-version="1.5.0">
- <wb-module deploy-name="spring-social-viadeo">
- <wb-resource deploy-path="/" source-path="/src/main/java"/>
- <wb-resource deploy-path="/" source-path="/src/main/resources"/>
- </wb-module>
-</project-modules>
View
5 spring-social-viadeo/.settings/org.eclipse.wst.common.project.facet.core.xml
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<faceted-project>
- <installed facet="java" version="1.6"/>
- <installed facet="jst.utility" version="1.0"/>
-</faceted-project>
View
8 spring-social-viadeo/.settings/org.maven.ide.eclipse.prefs
@@ -1,8 +0,0 @@
-#Sun Sep 11 18:57:50 CEST 2011
-activeProfiles=
-eclipse.preferences.version=1
-fullBuildGoals=process-test-resources
-resolveWorkspaceProjects=true
-resourceFilterGoals=process-resources resources\:testResources
-skipCompilerPlugin=true
-version=1
View
181 spring-social-viadeo/pom.xml
@@ -1,181 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.springframework.social</groupId>
- <artifactId>spring-social-viadeo</artifactId>
- <version>1.0.0.BUILD-SNAPSHOT</version>
- <name>Spring Social New API For Viadeo</name>
-
- <properties>
- <java-version>1.6</java-version>
- <org.springframework-version>3.1.0.M2</org.springframework-version>
- <org.slf4j-version>1.6.1</org.slf4j-version>
-
- <junit.version>4.8.2</junit.version>
- <easymock.version>3.0</easymock.version>
- <unitils.version>3.1</unitils.version>
- </properties>
-
- <distributionManagement>
- <repository>
- <id>maven-config-processor-plugin-repo-releases</id>
- <name>Maven Repository for Config Processor Plugin (releases)</name>
- <url>svn:https://spring-social-viadeo.googlecode.com/svn/maven-repo/releases
- </url>
- <uniqueVersion>false</uniqueVersion>
- </repository>
- <snapshotRepository>
- <id>maven-config-processor-plugin-repo-snapshots</id>
- <name>Maven Repository for Config Processor Plugin (snapshots)</name>
- <url>svn:https://spring-social-viadeo.googlecode.com/svn/maven-repo/snapshots
- </url>
- <uniqueVersion>false</uniqueVersion>
- </snapshotRepository>
- </distributionManagement>
-
- <dependencies>
-
- <!-- Spring -->
- <dependency>
- <groupId>org.springframework.social</groupId>
- <artifactId>spring-social-core</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <!-- Jackson JSON Mapper -->
- <dependency>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-mapper-asl</artifactId>
- <version>1.8.2</version>
- </dependency>
-
- <!-- Logging -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>${org.slf4j-version}</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- <version>${org.slf4j-version}</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>${org.slf4j-version}</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.16</version>
- <scope>runtime</scope>
- </dependency>
-
- <!-- Test -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
- <version>${easymock.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.unitils</groupId>
- <artifactId>unitils-easymock</artifactId>
- <version>${unitils.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.social</groupId>
- <artifactId>spring-social-test</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- <version>${org.springframework-version}</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
- <configuration>
- <source>${java-version}</source>
- <target>${java-version}</target>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <version>2.6</version>
- <dependencies>
- <dependency>
- <groupId>com.google.code.maven-svn-wagon</groupId>
- <artifactId>maven-svn-wagon</artifactId>
- <version>1.4</version>
- </dependency>
- </dependencies>
- </plugin>
-
- </plugins>
-
- </build>
-
- <repositories>
- <repository>
- <id>org.springframework.maven.release</id>
- <name>Spring Maven Release Repository</name>
- <url>http://maven.springframework.org/release</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- <!-- For testing against latest Spring snapshots -->
- <repository>
- <id>org.springframework.maven.snapshot</id>
- <name>Spring Maven Snapshot Repository</name>
- <url>http://maven.springframework.org/snapshot</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- <!-- For developing against latest Spring milestones -->
- <repository>
- <id>org.springframework.maven.milestone</id>
- <name>Spring Maven Milestone Repository</name>
- <url>http://maven.springframework.org/milestone</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
-
- </repositories>
-</project>
View
3  spring-social-viadeo/src/META-INF/MANIFEST.MF
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Class-Path:
-
View
3  spring-social-viadeo/src/main/java/META-INF/MANIFEST.MF
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Class-Path:
-
View
26 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/Career.java
@@ -1,26 +0,0 @@
-package org.springframework.social.viadeo.api;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * Model class representing the career of a member.
- */
-public class Career implements Serializable{
-
- /**
- *
- */
- private static final long serialVersionUID = -4448688201536453749L;
-
- private final List<Experience> experiences;
-
- public Career(List<Experience> experiences) {
- this.experiences = experiences;
- }
-
- public List<Experience> getExperiences() {
- return experiences;
- }
-
-}
View
48 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/Comment.java
@@ -1,48 +0,0 @@
-package org.springframework.social.viadeo.api;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * Model class representing a comment.
- */
-public class Comment implements Serializable{
-
- /**
- *
- */
- private static final long serialVersionUID = 912290621852237147L;
-
- private final String id;
-
- private final String message;
-
- private final ViadeoProfile from;
-
- private final Date createdDate;
-
- public Comment(String id, String message, ViadeoProfile from,
- Date createdDate) {
- this.id = id;
- this.message = message;
- this.from = from;
- this.createdDate = createdDate;
- }
-
- public String getId() {
- return id;
- }
-
- public String getMessage() {
- return message;
- }
-
- public ViadeoProfile getFrom() {
- return from;
- }
-
- public Date getCreatedDate() {
- return createdDate;
- }
-
-}
View
92 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/ContactCards.java
@@ -1,92 +0,0 @@
-package org.springframework.social.viadeo.api;
-
-import java.io.Serializable;
-import java.util.List;
-
-public class ContactCards implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = -898137483478431547L;
-
- private final String id;
-
- private String kind;
-
- private String city;
-
- private String postcode;
-
- private String country;
-
- private String region;
-
- private List<String> emails;
-
- private List<Phone> phones;
-
- public ContactCards(String id) {
- this.id = id;
- }
-
- public String getCity() {
- return city;
- }
-
- public void setCity(String city) {
- this.city = city;
- }
-
- public String getPostcode() {
- return postcode;
- }
-
- public void setPostcode(String postcode) {
- this.postcode = postcode;
- }
-
- public String getCountry() {
- return country;
- }
-
- public void setCountry(String country) {
- this.country = country;
- }
-
- public String getRegion() {
- return region;
- }
-
- public void setRegion(String region) {
- this.region = region;
- }
-
- public List<String> getEmails() {
- return emails;
- }
-
- public void setEmails(List<String> emails) {
- this.emails = emails;
- }
-
- public List<Phone> getPhones() {
- return phones;
- }
-
- public void setPhones(List<Phone> phones) {
- this.phones = phones;
- }
-
- public String getId() {
- return id;
- }
-
- public String getKind() {
- return kind;
- }
-
- public void setKind(String kind) {
- this.kind = kind;
- }
-}
View
66 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/Experience.java
@@ -1,66 +0,0 @@
-package org.springframework.social.viadeo.api;
-
-import java.io.Serializable;
-
-/**
- * Model class representing an experience in the career of a member.
- */
-public class Experience implements Serializable{
-
- /**
- *
- */
- private static final long serialVersionUID = -4912758692634536937L;
-
- private final String id;
-
- private final String position;
-
- private final String description;
-
- private final String companyName;
-
- private Integer beginYear;
-
- private Integer endYear;
-
- public Experience(String id, String position, String description,
- String companyName) {
- this.id = id;
- this.position = position;
- this.description = description;
- this.companyName = companyName;
- }
-
- public Integer getBeginYear() {
- return beginYear;
- }
-
- public void setBeginYear(Integer beginYear) {
- this.beginYear = beginYear;
- }
-
- public Integer getEndYear() {
- return endYear;
- }
-
- public void setEndYear(Integer endYear) {
- this.endYear = endYear;
- }
-
- public String getId() {
- return id;
- }
-
- public String getPosition() {
- return position;
- }
-
- public String getDescription() {
- return description;
- }
-
- public String getCompanyName() {
- return companyName;
- }
-}
View
20 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/GraphAPIException.java
@@ -1,20 +0,0 @@
-package org.springframework.social.viadeo.api;
-
-import org.springframework.social.SocialException;
-
-/**
- * Exception thrown when a Graph API usage error (such as an unknown connection
- * path) occurs.
- */
-@SuppressWarnings("serial")
-public class GraphAPIException extends SocialException {
-
- public GraphAPIException(String message) {
- super(message);
- }
-
- public GraphAPIException(String message, Throwable e) {
- super(message, e);
- }
-
-}
View
96 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/Job.java
@@ -1,96 +0,0 @@
-package org.springframework.social.viadeo.api;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * Model class representing a job.
- */
-public class Job implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = 7515333851500215109L;
-
- private final String id;
-
- private final String name;
-
- private final String link;
-
- private final Date updatedDate;
-
- private String title;
-
- private String description;
-
- private String category;
-
- private String experience;
-
- private String reference;
-
- public Job(String id, String name, String link, Date updatedDate) {
- this.id = id;
- this.name = name;
- this.link = link;
- this.updatedDate = updatedDate;
- }
-
- public String getId() {
- return id;
- }
-
- public String getName() {
- return name;
- }
-
- public String getLink() {
- return link;
- }
-
- public Date getUpdatedDate() {
- return updatedDate;
- }
-
- public String getTitle() {
- return title;
- }
-
- public void setTitle(String title) {
- this.title = title;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getCategory() {
- return category;
- }
-
- public void setCategory(String category) {
- this.category = category;
- }
-
- public String getExperience() {
- return experience;
- }
-
- public void setExperience(String experience) {
- this.experience = experience;
- }
-
- public String getReference() {
- return reference;
- }
-
- public void setReference(String reference) {
- this.reference = reference;
- }
-}
View
24 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/JobOperations.java
@@ -1,24 +0,0 @@
-package org.springframework.social.viadeo.api;
-
-import java.util.List;
-
-public interface JobOperations {
-
- /**
- * Search a job offer on viadeo.
- *
- * @param query
- * a group on a keyword.
- * @return a list of job
- */
- List<Job> search(String query);
-
- /**
- * Retrieve the detail for a job offer.
- *
- * @param objectId
- * the id of the job
- * @return the detailled job
- */
- Job getJob(String objectId);
-}
View
67 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/News.java
@@ -1,67 +0,0 @@
-package org.springframework.social.viadeo.api;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import org.springframework.social.viadeo.api.impl.Comments;
-
-
-/**
- * Model class representing an entry in a feed.
- */
-public class News implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = -2489468015293993653L;
-
- private final String id;
-
- private final String message;
-
- private final ViadeoProfile from;
-
- private final Date creationDate;
-
- private final Date updatedDate;
-
- private Comments comments;
-
- public News(String id, String message, ViadeoProfile from,
- Date creationDate, Date updatedDate) {
- this.id = id;
- this.message = message;
- this.from = from;
- this.creationDate = creationDate;
- this.updatedDate = updatedDate;
- }
-
- public String getId() {
- return id;
- }
-
- public String getMessage() {
- return message;
- }
-
- public ViadeoProfile getFrom() {
- return from;
- }
-
- public Date getCreationDate() {
- return creationDate;
- }
-
- public Date getUpdatedDate() {
- return updatedDate;
- }
-
- public Comments getComments() {
- return comments;
- }
-
- public void setComments(Comments comments) {
- this.comments = comments;
- }
-}
View
69 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/Phone.java
@@ -1,69 +0,0 @@
-package org.springframework.social.viadeo.api;
-
-import java.io.Serializable;
-
-import org.apache.commons.lang.builder.EqualsBuilder;
-
-public class Phone implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = -7992330053889482442L;
-
- private final String type;
- private final String country;
- private final String dialing;
- private final String number;
-
- public Phone(String type, String country, String dialing, String number) {
- this.type = type;
- this.country = country;
- this.dialing = dialing;
- this.number = number;
- }
-
- public String getType() {
- return type;
- }
-
- public String getCountry() {
- return country;
- }
-
- public String getDialing() {
- return dialing;
- }
-
- public String getNumber() {
- return number;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((country == null) ? 0 : country.hashCode());
- result = prime * result + ((dialing == null) ? 0 : dialing.hashCode());
- result = prime * result + ((number == null) ? 0 : number.hashCode());
- result = prime * result + ((type == null) ? 0 : type.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Phone other = (Phone) obj;
- return new EqualsBuilder()
- .append(this.getCountry(), other.getCountry()).append(
- this.getDialing(), other.getDialing()).append(
- this.getNumber(), other.getNumber()).append(
- this.getType(), other.getType()).isEquals();
- }
-
-}
View
97 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/UserOperations.java
@@ -1,97 +0,0 @@
-package org.springframework.social.viadeo.api;
-
-import java.util.List;
-
-public interface UserOperations {
-
- /**
- * Retrieves the profile for the authenticated user.
- *
- * @return the user's profile information.
- */
- ViadeoProfile getUserProfile();
-
- /**
- * Retrieves the profile for the specified user.
- *
- * @param userId
- * the Viadeo user ID to retrieve profile data for.
- * @return the user's profile information.
- */
- ViadeoProfile getUserProfile(String userId);
-
- /**
- * Retrieves a list of custom contacs lists belonging to the specified user.
- *
- * @return a list of contacts
- */
- List<ViadeoProfile> getContacts();
-
- /**
- * Retrieves a list of custom friend lists belonging to the authenticated
- * user.
- *
- * @param userId
- * the user's ID
- * @return a list of contacts
- */
- List<ViadeoProfile> getContacts(String userId);
-
- /**
- * Retrieves recent feed entries for the authenticated user.
- *
- * @return
- */
- List<News> getNewsFeed();
-
- /**
- * Retrieves recent feed entries for a given user.
- *
- * @param userId
- * @return
- */
- List<News> getNewsFeed(String userId);
-
- /**
- * Retrieves experiences for a given user.
- *
- * @return
- */
- List<Experience> getExperiences();
-
- /**
- * Retrieves experiences for the authenticated user.
- *
- * @param userId
- * @return
- */
- List<Experience> getExperiences(String userId);
-
- /**
- * Edit the status of the current user.
- *
- * @param status
- */
- void updateStatus(String status);
-
- /**
- * Search a user on viadeo.
- *
- * @param keyword
- */
- List<ViadeoProfile> search(String keyword);
-
- /**
- * Retrieve the visit cards of the current user.
- *
- * @return the contact cards.
- */
- List<ContactCards> getContactCards();
-
- /**
- * Retrieve the visit cards of a given user.
- *
- * @return the contact cards.
- */
- List<ContactCards> getContactCards(String userId);
-}
View
16 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/Viadeo.java
@@ -1,16 +0,0 @@
-package org.springframework.social.viadeo.api;
-
-import org.springframework.social.ApiBinding;
-import org.springframework.social.viadeo.api.impl.ViadeoTemplate;
-
-
-/**
- * Interface specifying a basic set of operations for interacting with Viadeo.
- * Implemented by {@link ViadeoTemplate}.
- */
-public interface Viadeo extends ApiBinding {
-
- UserOperations userOperations();
-
- JobOperations jobOperations();
-}
View
118 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/ViadeoProfile.java
@@ -1,118 +0,0 @@
-package org.springframework.social.viadeo.api;
-
-import java.io.Serializable;
-
-/**
- * Model class containing a user's Viadeo profile information.
- *
- */
-public class ViadeoProfile implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = -1973974445859297954L;
-
- private final String id;
-
- private final String gender;
-
- private final String firstName;
-
- private final String lastName;
-
- private final String nickName;
-
- private final String profileUrl;
-
- private final String largeImageUrl;
-
- private String smallImageUrl;
-
- private String headline;
-
- private String interests;
-
- private Long contactCount;
-
- public ViadeoProfile(String id, String gender, String firstName,
- String lastName, String nickName, String profileUrl,
- String largeImageUrl) {
- this.id = id;
- this.gender = gender;
- this.firstName = firstName;
- this.lastName = lastName;
- this.nickName = nickName;
- this.profileUrl = profileUrl;
- this.largeImageUrl = largeImageUrl;
- }
-
- /**
- * The user's Viadeo profile ID
- */
- public String getId() {
- return id;
- }
-
- /**
- * The user's first name
- */
- public String getFirstName() {
- return firstName;
- }
-
- /**
- * The user's last name
- */
- public String getLastName() {
- return lastName;
- }
-
- public String getNickName() {
- return nickName;
- }
-
- public String getProfileUrl() {
- return profileUrl;
- }
-
- public String getLargeImageUrl() {
- return largeImageUrl;
- }
-
- public String getHeadline() {
- return headline;
- }
-
- public void setHeadline(String headline) {
- this.headline = headline;
- }
-
- public String getInterests() {
- return interests;
- }
-
- public void setInterests(String interests) {
- this.interests = interests;
- }
-
- public String getGender() {
- return gender;
- }
-
- public Long getContactCount() {
- return contactCount;
- }
-
- public void setContactCount(Long contactCount) {
- this.contactCount = contactCount;
- }
-
- public String getSmallImageUrl() {
- return smallImageUrl;
- }
-
- public void setSmallImageUrl(String smallImageUrl) {
- this.smallImageUrl = smallImageUrl;
- }
-}
View
77 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/AbstractViadeoOperations.java
@@ -1,77 +0,0 @@
-package org.springframework.social.viadeo.api.impl;
-
-import java.net.URI;
-import java.util.Collections;
-import java.util.Map;
-
-import org.codehaus.jackson.map.exc.UnrecognizedPropertyException;
-import org.springframework.social.MissingAuthorizationException;
-import org.springframework.social.support.URIBuilder;
-import org.springframework.social.viadeo.api.GraphAPIException;
-import org.springframework.util.LinkedMultiValueMap;
-import org.springframework.util.MultiValueMap;
-import org.springframework.web.client.ResourceAccessException;
-
-abstract class AbstractViadeoOperations {
-
- static final String GRAPH_API_URL = "https://api.viadeo.com/";
-
- // static final String GRAPH_API_URL = "http://www.viadeo.com/";
-
- // static final String GRAPH_API_URL = "http://api.apnacircle.com/";
-
- static final String OBJECT_URL = GRAPH_API_URL + "{objectId}";
-
- private final boolean isAuthorized;
-
- protected final ViadeoTemplate viadeoTemplate;
-
- public AbstractViadeoOperations(ViadeoTemplate viadeoTemplate, boolean isAuthorized) {
- this.isAuthorized = isAuthorized;
- this.viadeoTemplate = viadeoTemplate;
- }
-
- protected void requireAuthorization() {
- if (!isAuthorized) {
- throw new MissingAuthorizationException();
- }
- }
-
- protected URIBuilder buildUri(String path, Map<String, String> params) {
- URIBuilder uriBuilder = viadeoTemplate.withAccessToken(GRAPH_API_URL + path);
- for (String paramName : params.keySet()) {
- uriBuilder.queryParam(paramName, String.valueOf(params.get(paramName)));
- }
- return uriBuilder;
- }
-
- protected URIBuilder buildUri(String path) {
- return buildUri(path, Collections.<String, String> emptyMap());
- }
-
- protected <T> T get(URI uri, Class<T> responseType) {
- return viadeoTemplate.getRestTemplate().getForObject(uri, responseType);
- }
-
- public <T> T get(String objectId, Class<T> type) {
- try {
- URI uri = buildUri(objectId).build();
- return get(uri, type);
- } catch (ResourceAccessException e) {
- // Handle the special case where an unknown alias results in an
- // error returned as a HTTP 200
- if (e.getCause() instanceof UnrecognizedPropertyException) {
- UnrecognizedPropertyException jsonException = (UnrecognizedPropertyException) e.getCause();
- if (jsonException.getUnrecognizedPropertyName().equals("error")) {
- throw new GraphAPIException("Unknown alias: " + objectId);
- }
- }
- throw new GraphAPIException("Unexpected graph API exception", e.getCause());
- }
- }
-
- protected <C> C post(URI uri, MultiValueMap<String, String> data, Class<C> responseType) {
- MultiValueMap<String, String> requestData = new LinkedMultiValueMap<String, String>(data);
- return viadeoTemplate.getRestTemplate().postForObject(uri, requestData, responseType);
- }
-}
View
26 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/Comments.java
@@ -1,26 +0,0 @@
-package org.springframework.social.viadeo.api.impl;
-
-import java.io.Serializable;
-import java.util.List;
-
-import org.springframework.social.viadeo.api.Comment;
-
-
-public class Comments implements Serializable{
-
- /**
- *
- */
- private static final long serialVersionUID = -8748950763266683264L;
-
- private final List<Comment> comments;
-
- public Comments(List<Comment> comments) {
- this.comments = comments;
- }
-
- public List<Comment> getComments() {
- return comments;
- }
-
-}
View
28 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/Contacts.java
@@ -1,28 +0,0 @@
-package org.springframework.social.viadeo.api.impl;
-
-import java.io.Serializable;
-import java.util.List;
-
-import org.springframework.social.viadeo.api.ViadeoProfile;
-
-
-/**
- * A model class containing a list of a user's connections on Viadeo.
- */
-public class Contacts implements Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = -9109438495194439081L;
-
- private final List<ViadeoProfile> contacts;
-
- public Contacts(List<ViadeoProfile> contacts) {
- this.contacts = contacts;
- }
-
- public List<ViadeoProfile> getContacts() {
- return contacts;
- }
-}
View
25 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/Feed.java
@@ -1,25 +0,0 @@
-package org.springframework.social.viadeo.api.impl;
-
-import java.io.Serializable;
-import java.util.List;
-
-import org.springframework.social.viadeo.api.News;
-
-
-public class Feed implements Serializable{
-
- /**
- *
- */
- private static final long serialVersionUID = -4312798721744954030L;
-
- private final List<News> news;
-
- public Feed(List<News> news) {
- this.news = news;
- }
-
- public List<News> getNews() {
- return news;
- }
-}
View
27 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/JobTemplate.java
@@ -1,27 +0,0 @@
-package org.springframework.social.viadeo.api.impl;
-
-import java.net.URI;
-import java.util.List;
-
-import org.springframework.social.viadeo.api.Job;
-import org.springframework.social.viadeo.api.JobOperations;
-
-public class JobTemplate extends AbstractViadeoOperations implements
- JobOperations {
-
- public JobTemplate(ViadeoTemplate viadeoTemplate, boolean isAuthorized) {
- super(viadeoTemplate, isAuthorized);
- }
-
- public List<Job> search(String query) {
- requireAuthorization();
- URI uri = buildUri("search/jobs").queryParam("q", query).queryParam(
- "limit", "50").build();
- return get(uri, JobsResult.class).getJobs();
- }
-
- public Job getJob(String objectId) {
- requireAuthorization();
- return get(objectId, Job.class);
- }
-}
View
27 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/JobsResult.java
@@ -1,27 +0,0 @@
-package org.springframework.social.viadeo.api.impl;
-
-import java.io.Serializable;
-import java.util.List;
-
-import org.springframework.social.viadeo.api.Job;
-
-
-
-public class JobsResult implements Serializable{
-
- /**
- *
- */
- private static final long serialVersionUID = -6183916769172344982L;
-
- private final List<Job> jobs;
-
- public List<Job> getJobs() {
- return jobs;
- }
-
- public JobsResult(List<Job> jobs) {
- this.jobs = jobs;
- }
-
-}
View
106 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/UserTemplate.java
@@ -1,106 +0,0 @@
-package org.springframework.social.viadeo.api.impl;
-
-import java.net.URI;
-import java.util.List;
-
-import org.springframework.social.viadeo.api.Career;
-import org.springframework.social.viadeo.api.ContactCards;
-import org.springframework.social.viadeo.api.Experience;
-import org.springframework.social.viadeo.api.News;
-import org.springframework.social.viadeo.api.UserOperations;
-import org.springframework.social.viadeo.api.ViadeoProfile;
-import org.springframework.util.LinkedMultiValueMap;
-import org.springframework.util.MultiValueMap;
-
-public class UserTemplate extends AbstractViadeoOperations implements UserOperations {
-
- private static final String LIMIT = "limit";
-
- private static final String FULL = "full";
-
- private static final String ME = "me";
-
- private static final String USER_DETAIL = "user_detail";
-
- public UserTemplate(ViadeoTemplate viadeoTemplate, boolean isAuthorized) {
- super(viadeoTemplate, isAuthorized);
- }
-
- @Override
- public ViadeoProfile getUserProfile() {
- requireAuthorization();
- return getUserProfile(ME);
- }
-
- @Override
- public ViadeoProfile getUserProfile(String userId) {
- return get(userId, ViadeoProfile.class);
- }
-
- @Override
- public List<ViadeoProfile> getContacts() {
- requireAuthorization();
- return getContacts(ME);
- }
-
- @Override
- public List<ViadeoProfile> getContacts(String userId) {
- URI uri = buildUri(userId + "/contacts").queryParam(USER_DETAIL, FULL).queryParam(LIMIT, "20").build();
- return get(uri, Contacts.class).getContacts();
- }
-
- @Override
- public List<News> getNewsFeed() {
- requireAuthorization();
- return getNewsFeed(ME);
- }
-
- @Override
- public List<News> getNewsFeed(String userId) {
- URI uri = buildUri(userId + "/home_newsfeed").queryParam(USER_DETAIL, FULL).queryParam(LIMIT, "50").build();
- return get(uri, Feed.class).getNews();
- }
-
- @Override
- public List<Experience> getExperiences() {
- requireAuthorization();
- return getExperiences(ME);
- }
-
- @Override
- public List<Experience> getExperiences(String userId) {
- URI uri = buildUri(userId + "/career").queryParam(USER_DETAIL, FULL).build();
- return get(uri, Career.class).getExperiences();
- }
-
- @Override
- public void updateStatus(String status) {
- requireAuthorization();
- if (status.length() > 140) {
- throw new IllegalArgumentException("The message is more than 140 caracters");
- }
- MultiValueMap<String, String> parts = new LinkedMultiValueMap<String, String>();
- parts.set("message", status);
- post(buildUri("status").build(), parts, String.class);
- }
-
- @Override
- public List<ViadeoProfile> search(String keyword) {
- requireAuthorization();
- URI uri = buildUri("search/users").queryParam(USER_DETAIL, FULL).queryParam("keyword", keyword)
- .queryParam(LIMIT, "50").build();
- return get(uri, Contacts.class).getContacts();
- }
-
- @Override
- public List<ContactCards> getContactCards(String userId) {
- requireAuthorization();
- URI uri = buildUri(userId + "/contact_cards").build();
- return get(uri, VisitCards.class).getContactCards();
- }
-
- @Override
- public List<ContactCards> getContactCards() {
- return getContactCards(ME);
- }
-}
View
103 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/ViadeoTemplate.java
@@ -1,103 +0,0 @@
-package org.springframework.social.viadeo.api.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.codehaus.jackson.map.ObjectMapper;
-import org.springframework.http.MediaType;
-import org.springframework.http.converter.HttpMessageConverter;
-import org.springframework.http.converter.json.MappingJacksonHttpMessageConverter;
-import org.springframework.social.NotAuthorizedException;
-import org.springframework.social.oauth2.AbstractOAuth2ApiBinding;
-import org.springframework.social.support.ClientHttpRequestFactorySelector;
-import org.springframework.social.support.URIBuilder;
-import org.springframework.social.viadeo.api.JobOperations;
-import org.springframework.social.viadeo.api.UserOperations;
-import org.springframework.social.viadeo.api.Viadeo;
-import org.springframework.social.viadeo.api.impl.json.ViadeoModule;
-
-public class ViadeoTemplate extends AbstractOAuth2ApiBinding implements Viadeo {
-
- private UserOperations userOperations;
-
- private JobOperations jobOperations;
-
- private final String accessToken;
-
- /**
- * Create a new instance of ViadeoTemplate. This constructor creates a new
- * ViadeoTemplate able to perform unauthenticated operations against
- * ViadeoTemplate's Graph API. Some operations do not require OAuth
- * authentication. For example, retrieving a specified user's profile does
- * not require authentication (although the data returned will be limited to
- * what is publicly available). A ViadeoTemplate created with this
- * constructor will support those operations. Those operations requiring
- * authentication will throw {@link NotAuthorizedException}.
- */
- public ViadeoTemplate() {
- this(null);
- initialize();
- }
-
- /**
- * Create a new instance of ViadeoTemplate. This constructor creates the
- * ViadeoTemplate using a given access token.
- *
- * @param accessToken
- * An access token given by Viadeo after a successful OAuth 2
- * authentication.
- */
- public ViadeoTemplate(String accessToken) {
- super(accessToken);
-
- this.accessToken = accessToken;
- initialize();
- }
-
- private void initialize() {
- registerViadeoJsonModule();
- // Wrap the request factory with a BufferingClientHttpRequestFactory so
- // that the error handler can do repeat reads on the response.getBody()
- super.setRequestFactory(ClientHttpRequestFactorySelector
- .bufferRequests(getRestTemplate().getRequestFactory()));
- initSubApis();
- }
-
- private void initSubApis() {
- // sub-apis
- userOperations = new UserTemplate(this, isAuthorized());
- jobOperations = new JobTemplate(this, isAuthorized());
- }
-
- private void registerViadeoJsonModule() {
- ObjectMapper objectMapper = new ObjectMapper();
- objectMapper.registerModule(new ViadeoModule());
-
- List<MediaType> supportedMediaTypes = new ArrayList<MediaType>(1);
- supportedMediaTypes.add(MediaType.ALL);
-
- List<HttpMessageConverter<?>> converters = getRestTemplate()
- .getMessageConverters();
- for (HttpMessageConverter<?> converter : converters) {
- if (converter instanceof MappingJacksonHttpMessageConverter) {
- MappingJacksonHttpMessageConverter jsonConverter = (MappingJacksonHttpMessageConverter) converter;
- jsonConverter.setSupportedMediaTypes(supportedMediaTypes);
- jsonConverter.setObjectMapper(objectMapper);
- }
- }
- }
-
- public URIBuilder withAccessToken(String uri) {
- return (accessToken == null) ? URIBuilder.fromUri(uri) : URIBuilder
- .fromUri(uri).queryParam("access_token", accessToken);
- }
-
- public UserOperations userOperations() {
- return userOperations;
- }
-
- public JobOperations jobOperations() {
- return jobOperations;
- }
-
-}
View
24 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/VisitCards.java
@@ -1,24 +0,0 @@
-package org.springframework.social.viadeo.api.impl;
-
-import java.io.Serializable;
-import java.util.List;
-
-import org.springframework.social.viadeo.api.ContactCards;
-
-public class VisitCards implements Serializable{
-
- /**
- *
- */
- private static final long serialVersionUID = 7349321974117003796L;
-
- private final List<ContactCards> contactCards;
-
- public VisitCards(List<ContactCards> contactCards) {
- this.contactCards = contactCards;
- }
-
- public List<ContactCards> getContactCards() {
- return contactCards;
- }
-}
View
19 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/CareerMixin.java
@@ -1,19 +0,0 @@
-package org.springframework.social.viadeo.api.impl.json;
-
-import java.util.List;
-
-import org.codehaus.jackson.annotate.JsonCreator;
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-import org.springframework.social.viadeo.api.Experience;
-
-/**
- * Annotated mixin to add Jackson annotations to Career.
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-abstract class CareerMixin {
-
- @JsonCreator
- CareerMixin(@JsonProperty("data") List<Experience> experiences) {
- }
-}
View
20 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/CommentMixin.java
@@ -1,20 +0,0 @@
-package org.springframework.social.viadeo.api.impl.json;
-
-import java.util.Date;
-
-import org.codehaus.jackson.annotate.JsonCreator;
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-import org.springframework.social.viadeo.api.ViadeoProfile;
-
-/**
- * Annotated mixin to add Jackson annotations to Comment.
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-abstract class CommentMixin {
-
- @JsonCreator
- CommentMixin(@JsonProperty("id") String id, @JsonProperty("message")String message, @JsonProperty("from")ViadeoProfile from,
- @JsonProperty("data")Date created_time) {
- }
-}
View
19 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/CommentsMixin.java
@@ -1,19 +0,0 @@
-package org.springframework.social.viadeo.api.impl.json;
-
-import java.util.List;
-
-import org.codehaus.jackson.annotate.JsonCreator;
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-import org.springframework.social.viadeo.api.Comment;
-
-/**
- * Annotated mixin to add Jackson annotations to Comments.
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-abstract class CommentsMixin {
-
- @JsonCreator
- CommentsMixin(@JsonProperty("data") List<Comment> comments) {
- }
-}
View
41 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/ContactCardsMixin.java
@@ -1,41 +0,0 @@
-package org.springframework.social.viadeo.api.impl.json;
-
-import java.util.List;
-
-import org.codehaus.jackson.annotate.JsonCreator;
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-import org.springframework.social.viadeo.api.Phone;
-
-/**
- * Annotated mixin to add Jackson annotations to ContactCards.
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-abstract class ContactCardsMixin {
-
- @JsonCreator
- ContactCardsMixin(@JsonProperty("id") String id) {
- }
-
- @JsonProperty("kind")
- String kind;
-
- @JsonProperty("city")
- String city;
-
- @JsonProperty("postcode")
- String postcode;
-
- @JsonProperty("country")
- String country;
-
- @JsonProperty("region")
- String region;
-
- @JsonProperty("emails")
- List<String> emails;
-
- @JsonProperty("phones")
- List<Phone> phones;
-
-}
View
21 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/ContactsMixin.java
@@ -1,21 +0,0 @@
-package org.springframework.social.viadeo.api.impl.json;
-
-import java.util.List;
-
-import org.codehaus.jackson.annotate.JsonCreator;
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-import org.springframework.social.viadeo.api.ViadeoProfile;
-
-
-/**
- * Annotated mixin to add Jackson annotations to Contacts.
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-abstract class ContactsMixin {
-
- @JsonCreator
- ContactsMixin(@JsonProperty("data") List<ViadeoProfile> contacts) {
- }
-
-}
View
22 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/ExperienceMixin.java
@@ -1,22 +0,0 @@
-package org.springframework.social.viadeo.api.impl.json;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-/**
- * Annotated mixin to add Jackson annotations to Experience.
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-abstract class ExperienceMixin {
-
- ExperienceMixin(@JsonProperty("id") String id,
- @JsonProperty("position") String position,
- @JsonProperty("description") String description,
- @JsonProperty("companyName") String companyName) {
- }
-
- @JsonProperty("begin")
- Integer beginYear;
-
- @JsonProperty("end")
- Integer endYear;
-}
View
21 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/FeedMixin.java
@@ -1,21 +0,0 @@
-package org.springframework.social.viadeo.api.impl.json;
-
-import java.util.List;
-
-import org.codehaus.jackson.annotate.JsonCreator;
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-import org.springframework.social.viadeo.api.News;
-
-
-/**
- * Annotated mixin to add Jackson annotations to Feed.
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-abstract class FeedMixin {
-
- @JsonCreator
- FeedMixin(@JsonProperty("data") List<News> news) {
- }
-
-}
View
36 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/JobMixin.java
@@ -1,36 +0,0 @@
-package org.springframework.social.viadeo.api.impl.json;
-
-import java.util.Date;
-
-import org.codehaus.jackson.annotate.JsonCreator;
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-
-/**
- * Annotated mixin to add Jackson annotations to Job.
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-abstract class JobMixin {
-
- @JsonCreator
- JobMixin(@JsonProperty("id") String id, @JsonProperty("name") String name,
- @JsonProperty("link") String link,
- @JsonProperty("updated_time") Date updatedDate) {
- }
-
- @JsonProperty("title")
- String title;
-
- @JsonProperty("description")
- String description;
-
- @JsonProperty("category")
- String category;
-
- @JsonProperty("experience")
- String experience;
-
- @JsonProperty("reference")
- String reference;
-
-}
View
17 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/JobsResultMixin.java
@@ -1,17 +0,0 @@
-package org.springframework.social.viadeo.api.impl.json;
-
-import java.util.List;
-
-import org.codehaus.jackson.annotate.JsonCreator;
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-import org.springframework.social.viadeo.api.Job;
-
-
-@JsonIgnoreProperties(ignoreUnknown = true)
-abstract class JobsResultMixin {
-
- @JsonCreator
- JobsResultMixin(@JsonProperty("data") List<Job> jobs) {
- }
-}
View
29 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/NewsMixin.java
@@ -1,29 +0,0 @@
-package org.springframework.social.viadeo.api.impl.json;
-
-import java.util.Date;
-
-import org.codehaus.jackson.annotate.JsonCreator;
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-import org.springframework.social.viadeo.api.ViadeoProfile;
-import org.springframework.social.viadeo.api.impl.Comments;
-
-
-/**
- * Annotated mixin to add Jackson annotations to News.
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-abstract class NewsMixin {
-
- @JsonCreator
- NewsMixin(@JsonProperty("id") String id,
- @JsonProperty("message") String message,
- @JsonProperty("from") ViadeoProfile from,
- @JsonProperty("creation_date") Date creationDate,
- @JsonProperty("updated_time") Date updatedDate) {
- }
-
- @JsonProperty("comments")
- Comments comments;
-
-}
View
20 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/PhoneMixin.java
@@ -1,20 +0,0 @@
-package org.springframework.social.viadeo.api.impl.json;
-
-import org.codehaus.jackson.annotate.JsonCreator;
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-
-
-/**
- * Annotated mixin to add Jackson annotations to Phone.
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-abstract class PhoneMixin {
-
- @JsonCreator
- PhoneMixin(@JsonProperty("type") String type,
- @JsonProperty("country") String country,
- @JsonProperty("dialing") String dialing,
- @JsonProperty("number") String number) {
- }
-}
View
51 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/ViadeoModule.java
@@ -1,51 +0,0 @@
-package org.springframework.social.viadeo.api.impl.json;
-
-import org.codehaus.jackson.Version;
-import org.codehaus.jackson.map.module.SimpleModule;
-import org.springframework.social.viadeo.api.Career;
-import org.springframework.social.viadeo.api.Comment;
-import org.springframework.social.viadeo.api.ContactCards;
-import org.springframework.social.viadeo.api.Experience;
-import org.springframework.social.viadeo.api.Job;
-import org.springframework.social.viadeo.api.News;
-import org.springframework.social.viadeo.api.Phone;
-import org.springframework.social.viadeo.api.ViadeoProfile;
-import org.springframework.social.viadeo.api.impl.Comments;
-import org.springframework.social.viadeo.api.impl.Contacts;
-import org.springframework.social.viadeo.api.impl.Feed;
-import org.springframework.social.viadeo.api.impl.JobsResult;
-import org.springframework.social.viadeo.api.impl.VisitCards;
-
-/**
- * Jackson module for setting up mixin annotations on Viadeo model types. This
- * enables the use of Jackson annotations without directly annotating the model
- * classes themselves.
- */
-public class ViadeoModule extends SimpleModule {
-
- public ViadeoModule() {
- super("ViadeoModule", new Version(1, 0, 0, null));
- }
-
- @Override
- public void setupModule(SetupContext context) {
- context.setMixInAnnotations(ViadeoProfile.class,
- ViadeoProfileMixin.class);
- context.setMixInAnnotations(Contacts.class, ContactsMixin.class);
- context.setMixInAnnotations(Feed.class, FeedMixin.class);
- context.setMixInAnnotations(News.class, NewsMixin.class);
- context.setMixInAnnotations(Experience.class, ExperienceMixin.class);
- context.setMixInAnnotations(Career.class, CareerMixin.class);
- context.setMixInAnnotations(Comment.class, CommentMixin.class);
- context.setMixInAnnotations(Comments.class, CommentsMixin.class);
- context.setMixInAnnotations(Job.class, JobMixin.class);
- context.setMixInAnnotations(JobsResult.class, JobsResultMixin.class);
- context.setMixInAnnotations(Phone.class, PhoneMixin.class);
- context
- .setMixInAnnotations(ContactCards.class,
- ContactCardsMixin.class);
- context
- .setMixInAnnotations(VisitCards.class,
- VisitCardsMixin.class);
- }
-}
View
34 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/ViadeoProfileMixin.java
@@ -1,34 +0,0 @@
-package org.springframework.social.viadeo.api.impl.json;
-
-import org.codehaus.jackson.annotate.JsonCreator;
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-
-/**
- * Annotated mixin to add Jackson annotations to ViadeoProfile.
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-abstract class ViadeoProfileMixin {
-
- @JsonCreator
- ViadeoProfileMixin(@JsonProperty("id") String id,
- @JsonProperty("gender") String gender,
- @JsonProperty("first_name") String firstName,
- @JsonProperty("last_name") String lastName,
- @JsonProperty("nickname") String nickName,
- @JsonProperty("link") String profileUrl,
- @JsonProperty("picture_large") String imageUrl) {
- }
-
- @JsonProperty("contact_count")
- Long contactCount;
-
- @JsonProperty("headline")
- String headline;
-
- @JsonProperty("interests")
- String interests;
-
- @JsonProperty("picture_small")
- String smallImageUrl;
-}
View
19 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/api/impl/json/VisitCardsMixin.java
@@ -1,19 +0,0 @@
-package org.springframework.social.viadeo.api.impl.json;
-
-import java.util.List;
-
-import org.codehaus.jackson.annotate.JsonCreator;
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-import org.springframework.social.viadeo.api.ContactCards;
-
-/**
- * Annotated mixin to add Jackson annotations to VisitCards.
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-abstract class VisitCardsMixin {
-
- @JsonCreator
- VisitCardsMixin(@JsonProperty("data") List<ContactCards> contactCards) {
- }
-}
View
43 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/connect/ViadeoAdapter.java
@@ -1,43 +0,0 @@
-package org.springframework.social.viadeo.connect;
-
-import org.springframework.social.ApiException;
-import org.springframework.social.connect.ApiAdapter;
-import org.springframework.social.connect.ConnectionValues;
-import org.springframework.social.connect.UserProfile;
-import org.springframework.social.connect.UserProfileBuilder;
-import org.springframework.social.viadeo.api.Viadeo;
-import org.springframework.social.viadeo.api.ViadeoProfile;
-
-public class ViadeoAdapter implements ApiAdapter<Viadeo> {
-
- public boolean test(Viadeo viadeo) {
- try {
- viadeo.userOperations().getUserProfile();
- return true;
- } catch (ApiException e) {
- return false;
- }
- }
-
- public void setConnectionValues(Viadeo viadeo, ConnectionValues values) {
- ViadeoProfile profile = viadeo.userOperations().getUserProfile();
- values.setProviderUserId(profile.getId());
- values.setDisplayName(profile.getFirstName() + " "
- + profile.getLastName());
- values.setImageUrl(profile.getLargeImageUrl());
- values.setProfileUrl(profile.getProfileUrl());
- }
-
- public UserProfile fetchUserProfile(Viadeo viadeo) {
- ViadeoProfile profile = viadeo.userOperations().getUserProfile();
- return new UserProfileBuilder().setName(
- profile.getFirstName() + " " + profile.getLastName())
- .setFirstName(profile.getFirstName()).setLastName(
- profile.getLastName()).setUsername(
- profile.getNickName()).build();
- }
-
- public void updateStatus(Viadeo viadeo, String message) {
- // not supported yet
- }
-}
View
13 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/connect/ViadeoConnectionFactory.java
@@ -1,13 +0,0 @@
-package org.springframework.social.viadeo.connect;
-
-import org.springframework.social.connect.support.OAuth2ConnectionFactory;
-import org.springframework.social.viadeo.api.Viadeo;
-
-
-public class ViadeoConnectionFactory extends OAuth2ConnectionFactory<Viadeo> {
-
- public ViadeoConnectionFactory(String clientId, String clientSecret) {
- super("viadeo", new ViadeoServiceProvider(clientId, clientSecret), new ViadeoAdapter());
- }
-
-}
View
46 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/connect/ViadeoOAuth2Template.java
@@ -1,46 +0,0 @@
-package org.springframework.social.viadeo.connect;
-
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.springframework.http.MediaType;
-import org.springframework.http.converter.AbstractHttpMessageConverter;
-import org.springframework.http.converter.FormHttpMessageConverter;
-import org.springframework.http.converter.HttpMessageConverter;
-import org.springframework.http.converter.json.MappingJacksonHttpMessageConverter;
-import org.springframework.social.oauth2.OAuth2Template;
-import org.springframework.social.support.ClientHttpRequestFactorySelector;
-import org.springframework.web.client.RestTemplate;
-
-/**
- * Viadeo-specific extension of OAuth2Template to use a RestTemplate that recognizes form-encoded responses as
- * "application/x-www-form-urlencoded". Viadeo token responses are form-encoded results with a content type of
- * "application/x-www-form-urlencoded", which prevents the FormHttpMessageConverter registered by default from parsing
- * the results.
- */
-public class ViadeoOAuth2Template extends OAuth2Template {
-
- public ViadeoOAuth2Template(String clientId, String clientSecret) {
- super(clientId, clientSecret, "https://secure.viadeo.com/oauth-provider/authorize2",
- "https://secure.viadeo.com/oauth-provider/access_token2");
- }
-
- @Override
- protected RestTemplate createRestTemplate() {
- RestTemplate restTemplate = new RestTemplate(ClientHttpRequestFactorySelector.getRequestFactory());
- List<HttpMessageConverter<?>> converters = new ArrayList<HttpMessageConverter<?>>(2);
- converters.add(new FormHttpMessageConverter());
-
- AbstractHttpMessageConverter<?> jsonConverter = new MappingJacksonHttpMessageConverter();
- List<MediaType> supportedMediaTypes = new ArrayList<MediaType>(3);
- supportedMediaTypes.add(new MediaType("application", "json", Charset.forName("UTF-8")));
- supportedMediaTypes.add(MediaType.APPLICATION_JSON);
- supportedMediaTypes.add(MediaType.APPLICATION_FORM_URLENCODED);
- jsonConverter.setSupportedMediaTypes(supportedMediaTypes);
-
- converters.add(jsonConverter);
- restTemplate.setMessageConverters(converters);
- return restTemplate;
- }
-}
View
20 spring-social-viadeo/src/main/java/org/springframework/social/viadeo/connect/ViadeoServiceProvider.java
@@ -1,20 +0,0 @@
-package org.springframework.social.viadeo.connect;
-
-import org.springframework.social.oauth2.AbstractOAuth2ServiceProvider;
-import org.springframework.social.viadeo.api.Viadeo;
-import org.springframework.social.viadeo.api.impl.ViadeoTemplate;
-
-
-public final class ViadeoServiceProvider extends
- AbstractOAuth2ServiceProvider<Viadeo> {
-
- public ViadeoServiceProvider(String clientId, String clientSecret) {
- super(new ViadeoOAuth2Template(clientId, clientSecret));
- }
-
- @Override
- public Viadeo getApi(String accessToken) {
- return new ViadeoTemplate(accessToken);
- }
-
-}
View
7 spring-social-viadeo/src/main/resources/log4j.properties
@@ -1,7 +0,0 @@
-log4j.rootLogger=error, stdout
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
-
-log4j.category.org.springframework=debug
-log4j.category.org.codehaus.jackson=debug
View
34 spring-social-viadeo/src/test/java/org/springframework/social/viadeo/api/impl/AbstractViadeoApiTest.java
@@ -1,34 +0,0 @@
-package org.springframework.social.viadeo.api.impl;
-
-import org.junit.Before;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.MediaType;
-import org.springframework.social.test.client.MockRestServiceServer;
-import org.springframework.social.viadeo.api.impl.ViadeoTemplate;
-
-public abstract class AbstractViadeoApiTest {
- protected static final String ACCESS_TOKEN = "ACCESS_TOKEN";
-
- protected ViadeoTemplate viadeo;
- protected ViadeoTemplate unauthorizedViadeo;
- protected MockRestServiceServer mockServer;
- protected HttpHeaders responseHeaders;
-
- @Before
- public void setup() {
- viadeo = new ViadeoTemplate(ACCESS_TOKEN);
- unauthorizedViadeo = new ViadeoTemplate();
- mockServer = MockRestServiceServer.createServer(viadeo
- .getRestTemplate());
- responseHeaders = new HttpHeaders();
- responseHeaders.setContentType(MediaType.APPLICATION_JSON);
- MockRestServiceServer
- .createServer(unauthorizedViadeo.getRestTemplate());
- }
-
- protected Resource jsonResource(String filename) {
- return new ClassPathResource(filename + ".json", getClass());
- }
-}
View
51 spring-social-viadeo/src/test/java/org/springframework/social/viadeo/api/impl/JobTemplateTest.java
@@ -1,51 +0,0 @@
-package org.springframework.social.viadeo.api.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.springframework.http.HttpMethod.GET;
-import static org.springframework.social.test.client.RequestMatchers.method;
-import static org.springframework.social.test.client.RequestMatchers.requestTo;
-import static org.springframework.social.test.client.ResponseCreators.withResponse;
-
-import java.util.List;
-
-import org.junit.Test;
-import org.springframework.social.NotAuthorizedException;
-import org.springframework.social.viadeo.api.Job;
-
-public class JobTemplateTest extends AbstractViadeoApiTest {
-
- @Test
- public void searchJobs() {
- mockServer.expect(requestTo("https://api.viadeo.com/search/jobs?access_token=ACCESS_TOKEN&q=java&limit=50"))
- .andExpect(method(GET)).andRespond(withResponse(jsonResource("testdata/job-search"), responseHeaders));
-
- List<Job> jobs = viadeo.jobOperations().search("java");
- assertEquals(50, jobs.size());
- mockServer.verify();
- }
-
- @Test(expected = NotAuthorizedException.class)
- public void searchJobs_unauthorized() {
- unauthorizedViadeo.jobOperations().search("java");
- }
-
- @Test
- public void getJobWithAndId() {
- mockServer.expect(requestTo("https://api.viadeo.com/hEVdvbpdwpmtumjAmIhnhuzbhA?access_token=ACCESS_TOKEN"))
- .andExpect(method(GET)).andRespond(withResponse(jsonResource("testdata/detailled-job"), responseHeaders));
-
- Job job = viadeo.jobOperations().getJob("hEVdvbpdwpmtumjAmIhnhuzbhA");
-
- assertEquals("hEVdvbpdwpmtumjAmIhnhuzbhA", job.getId());
- assertEquals("Graduate", job.getExperience());
- assertEquals("Informatique - Reseaux - Telecoms - Internet", job.getCategory());
- assertEquals("DEVELOPPEURS H/F", job.getTitle());
- assertEquals("", job.getName());
- mockServer.verify();
- }
-
- @Test(expected = NotAuthorizedException.class)
- public void getJobWithAndId_unauthorized() {
- unauthorizedViadeo.jobOperations().getJob("hEVdvbpdwpmtumjAmIhnhuzbhA");
- }
-}
View
289 spring-social-viadeo/src/test/java/org/springframework/social/viadeo/api/impl/UserTemplateTest.java
@@ -1,289 +0,0 @@
-package org.springframework.social.viadeo.api.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.springframework.http.HttpMethod.GET;
-import static org.springframework.http.HttpMethod.POST;
-import static org.springframework.social.test.client.RequestMatchers.body;
-import static org.springframework.social.test.client.RequestMatchers.method;
-import static org.springframework.social.test.client.RequestMatchers.requestTo;
-import static org.springframework.social.test.client.ResponseCreators.withResponse;
-
-import java.util.List;
-
-import org.junit.Test;
-import org.springframework.social.NotAuthorizedException;
-import org.springframework.social.support.URIBuilder;
-import org.springframework.social.viadeo.api.ContactCards;
-import org.springframework.social.viadeo.api.Experience;
-import org.springframework.social.viadeo.api.News;
-import org.springframework.social.viadeo.api.Phone;
-import org.springframework.social.viadeo.api.ViadeoProfile;
-
-public class UserTemplateTest extends AbstractViadeoApiTest {
-
- @Test
- public void getCurrentUser() {
- mockServer.expect(requestTo("https://api.viadeo.com/me?access_token=ACCESS_TOKEN")).andExpect(method(GET))
- .andRespond(withResponse(jsonResource("testdata/full-profile-me"), responseHeaders));
-
- ViadeoProfile profile = viadeo.userOperations().getUserProfile();
- assertEquals("EjtftevbyiugaIfDfVizDgymxg", profile.getId());
- assertEquals("M", profile.getGender());
- assertEquals("Vincent", profile.getFirstName());
- assertEquals("DEVILLERS", profile.getLastName());
- assertEquals("vincent.devillers1", profile.getNickName());
- assertEquals("http://www.viadeo.com/profile/0021g557w9j1iw4m", profile.getProfileUrl());
- assertEquals(Long.valueOf(146), profile.getContactCount());
- assertEquals("Karate (2eme Dan), piano, natation, apnee libre, robotique", profile.getInterests());
- assertEquals("Ingenieur d'etudes et de developpement, Viadeo", profile.getHeadline());
- mockServer.verify();
- }
-
- @Test(expected = NotAuthorizedException.class)
- public void getCurrentUser_unauthorized() {
- unauthorizedViadeo.userOperations().getUserProfile();
- }
-
- @Test
- public void getUserProfileById() {
- mockServer.expect(requestTo("https://api.viadeo.com/EjtftevbyiugaIfDfVizDgymxg?access_token=ACCESS_TOKEN"))
- .andExpect(method(GET)).andRespond(withResponse(jsonResource("testdata/full-profile-by-id"), responseHeaders));
-
- ViadeoProfile profile = viadeo.userOperations().getUserProfile("EjtftevbyiugaIfDfVizDgymxg");
- assertEquals("EjtftevbyiugaIfDfVizDgymxg", profile.getId());
- assertEquals("M", profile.getGender());
- assertEquals("Vincent", profile.getFirstName());
- assertEquals("DEVILLERS", profile.getLastName());
- assertEquals("vincent.devillers1", profile.getNickName());
- assertEquals("http://www.viadeo.com/profile/0021g557w9j1iw4m", profile.getProfileUrl());
- assertEquals(Long.valueOf(146), profile.getContactCount());
- assertEquals("Karate (2eme Dan), piano, natation, apnee libre, robotique", profile.getInterests());
- assertEquals("Ingenieur d'etudes et de developpement, Viadeo", profile.getHeadline());
- mockServer.verify();
- }
-
- @Test
- public void getCurrentContacts() {
- mockServer
- .expect(
- requestTo(URIBuilder.fromUri(
- "https://api.viadeo.com/me/contacts?access_token=ACCESS_TOKEN&user_detail=full&limit=20").build()))
- .andExpect(method(GET))
- .andRespond(withResponse(jsonResource("testdata/full-contacts-for-me"), responseHeaders));
-
- List<ViadeoProfile> contacts = viadeo.userOperations().getContacts();
- assertNotNull(contacts);
- assertEquals(20, contacts.size());
- mockServer.verify();
- }
-
- @Test(expected = NotAuthorizedException.class)
- public void getCurrentContacts_unauthorized() {
- unauthorizedViadeo.userOperations().getContacts();
- }
-
- @Test
- public void getContactsForId() {
- mockServer
- .expect(