diff --git a/sign-in/spring-mvc-normal/src/test/java/org/springframework/social/connect/support/TestConnection.java b/sign-in/spring-mvc-normal/src/test/java/org/springframework/social/connect/support/TestConnection.java index 7c1f60e..e9a3472 100644 --- a/sign-in/spring-mvc-normal/src/test/java/org/springframework/social/connect/support/TestConnection.java +++ b/sign-in/spring-mvc-normal/src/test/java/org/springframework/social/connect/support/TestConnection.java @@ -2,7 +2,6 @@ import org.springframework.social.connect.ConnectionData; import org.springframework.social.connect.UserProfile; -import org.springframework.social.connect.support.AbstractConnection; /** * @author Petri Kainulainen diff --git a/sign-in/spring-mvc-normal/src/test/java/org/springframework/social/connect/support/TestConnectionBuilder.java b/sign-in/spring-mvc-normal/src/test/java/org/springframework/social/connect/support/TestConnectionBuilder.java index 03843f3..ae783a2 100644 --- a/sign-in/spring-mvc-normal/src/test/java/org/springframework/social/connect/support/TestConnectionBuilder.java +++ b/sign-in/spring-mvc-normal/src/test/java/org/springframework/social/connect/support/TestConnectionBuilder.java @@ -9,10 +9,14 @@ */ public class TestConnectionBuilder { + private String accessToken; + private String displayName; private String email; + private Long expireTime; + private String firstName; private String imageUrl; @@ -25,12 +29,21 @@ public class TestConnectionBuilder { private String providerUserId; + private String refreshToken; + + private String secret; + private UserProfileBuilder userProfileBuilder; public TestConnectionBuilder() { } + public TestConnectionBuilder accessToken(String accessToken) { + this.accessToken = accessToken; + return this; + } + public TestConnectionBuilder displayName(String displayName) { this.displayName = displayName; return this; @@ -41,6 +54,11 @@ public TestConnectionBuilder email(String email) { return this; } + public TestConnectionBuilder expireTime(Long expireTime) { + this.expireTime = expireTime; + return this; + } + public TestConnectionBuilder firstName(String firstName) { this.firstName = firstName; return this; @@ -71,6 +89,16 @@ public TestConnectionBuilder providerUserId(String providerUserId) { return this; } + public TestConnectionBuilder refreshToken(String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + public TestConnectionBuilder secret(String secret) { + this.secret = secret; + return this; + } + public TestConnectionBuilder userProfile() { userProfileBuilder = new UserProfileBuilder(); return this; @@ -82,12 +110,12 @@ public TestConnection build() { displayName, profileUrl, imageUrl, - null, - null, - null, - null); + accessToken, + secret, + refreshToken, + expireTime); - UserProfile userProfile = new UserProfileBuilder() + UserProfile userProfile = userProfileBuilder .setEmail(email) .setFirstName(firstName) .setLastName(lastName) diff --git a/sign-in/spring-mvc-normal/src/test/java/org/springframework/social/connect/web/ProviderSignInAttemptStub.java b/sign-in/spring-mvc-normal/src/test/java/org/springframework/social/connect/web/ProviderSignInAttemptStub.java index 91928be..ee82ace 100644 --- a/sign-in/spring-mvc-normal/src/test/java/org/springframework/social/connect/web/ProviderSignInAttemptStub.java +++ b/sign-in/spring-mvc-normal/src/test/java/org/springframework/social/connect/web/ProviderSignInAttemptStub.java @@ -1,7 +1,6 @@ package org.springframework.social.connect.web; import org.springframework.social.connect.Connection; -import org.springframework.social.connect.web.ProviderSignInAttempt; import java.util.HashSet; import java.util.Set;