// Path: sdk/src/main/java/com/stormpath/sdk/models/AccountStore.java
// public class AccountStore {
//     private String href;
// 
//     private Map<String, String> provider;
// 
//     private String authorizeUri;
// 
//     public String getHref() {
//         return href;
//     }
// 
//     public String getProviderId() {
//         return provider.get("providerId");
//     }
// 
//     public String getAuthorizeUri() {
//         return authorizeUri;
//     }
// }
// 
// Path: sdk/src/main/java/com/stormpath/sdk/models/LoginModel.java
// public class LoginModel {
//     private List<FormField> formFields;
//     private List<AccountStore> accountStores;
// 
//     public List<FormField> getFormFields() {
//         return formFields;
//     }
// 
//     public List<AccountStore> getAccountStores() {
//         return accountStores;
//     }
// }
// 
// Path: sdk/src/main/java/com/stormpath/sdk/models/StormpathError.java
// public class StormpathError implements Serializable {
// 
//     @Json(name = "status")
//     private int status;
// 
//     @Json(name = "message")
//     private String message;
// 
//     @Json(name = "code")
//     private int code;
// 
//     @Json(name = "developerMessage")
//     private String developerMessage;
// 
//     @Json(name = "moreInfo")
//     private String moreInfo;
// 
//     @Nullable
//     private transient Throwable throwable;
// 
//     /**
//      * Constructor for manually building an error when a local exception happens.
//      *
//      * @param message   a user-friendly message
//      * @param throwable the exception we caught
//      */
//     public StormpathError(String message, @NonNull Throwable throwable) {
//         this.throwable = throwable;
//         this.message = message;
//         this.developerMessage = throwable.getMessage();
//         this.status = -1;
//         this.code = -1;
//     }
// 
//     public int status() {
//         return status;
//     }
// 
//     /**
//      * @return an end-user error message
//      */
//     public String message() {
//         return message;
//     }
// 
//     public int code() {
//         return code;
//     }
// 
//     public String developerMessage() {
//         return developerMessage;
//     }
// 
//     public String moreInfo() {
//         return moreInfo;
//     }
// 
//     /**
//      * @return the throwable which caused the error, or null if the error was returned by the API
//      */
//     @Nullable
//     public Throwable throwable() {
//         return throwable;
//     }
// }


import com.stormpath.sdk.models.AccountStore;
import com.stormpath.sdk.models.LoginModel;
import com.stormpath.sdk.models.StormpathError;
import org.junit.Test;
import java.net.HttpURLConnection;
import okhttp3.mockwebserver.RecordedRequest;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.stub;
import static org.mockito.Mockito.verify;
        enqueueResponse("stormpath-social-providers-response.json");
        StormpathCallback<LoginModel> callback = mock(StormpathCallback.class);
        Stormpath.apiManager.getLoginModel(callback);

        verify(callback).onSuccess(any(LoginModel.class));
    }

    @Test
    public void successfulFetchReturnsCorrectData() throws Exception {
        stub(mockPlatform().preferenceStore().getAccessToken()).toReturn("abcdefghijklmnopqrstuvwyxz0123456789");

        SocialProvidersCallback callback = new SocialProvidersCallback();
        enqueueResponse("stormpath-social-providers-response.json");

        Stormpath.apiManager.getLoginModel(callback);
        assertThat(callback.loginModel.getAccountStores()).hasSize(3);
        AccountStore facebook = callback.loginModel.getAccountStores().get(0);
        AccountStore google = callback.loginModel.getAccountStores().get(1);
        AccountStore linkedin = callback.loginModel.getAccountStores().get(2);

        assertThat(facebook.getProviderId()).isEqualTo("facebook");
        assertThat(facebook.getHref()).isEqualTo("1234567890123456");

        assertThat(google.getProviderId()).isEqualTo("google");
        assertThat(google.getHref()).isEqualTo("123456789012-abcdefghijklmnopqrstuwvxyz123456.apps.googleusercontent.com");

        assertThat(linkedin.getProviderId()).isEqualTo("linkedin");
        assertThat(linkedin.getHref()).isEqualTo("abcdef12345678");
    }

// Path: sdk/src/main/java/com/stormpath/sdk/models/AccountStore.java
// public class AccountStore {
//     private String href;
// 
//     private Map<String, String> provider;
// 
//     private String authorizeUri;
// 
//     public String getHref() {
//         return href;
//     }
// 
//     public String getProviderId() {
//         return provider.get("providerId");
//     }
// 
//     public String getAuthorizeUri() {
//         return authorizeUri;
//     }
// }
// 
// Path: sdk/src/main/java/com/stormpath/sdk/models/LoginModel.java
// public class LoginModel {
//     private List<FormField> formFields;
//     private List<AccountStore> accountStores;
// 
//     public List<FormField> getFormFields() {
//         return formFields;
//     }
// 
//     public List<AccountStore> getAccountStores() {
//         return accountStores;
//     }
// }
// 
// Path: sdk/src/main/java/com/stormpath/sdk/models/StormpathError.java
// public class StormpathError implements Serializable {
// 
//     @Json(name = "status")
//     private int status;
// 
//     @Json(name = "message")
//     private String message;
// 
//     @Json(name = "code")
//     private int code;
// 
//     @Json(name = "developerMessage")
//     private String developerMessage;
// 
//     @Json(name = "moreInfo")
//     private String moreInfo;
// 
//     @Nullable
//     private transient Throwable throwable;
// 
//     /**
//      * Constructor for manually building an error when a local exception happens.
//      *
//      * @param message   a user-friendly message
//      * @param throwable the exception we caught
//      */
//     public StormpathError(String message, @NonNull Throwable throwable) {
//         this.throwable = throwable;
//         this.message = message;
//         this.developerMessage = throwable.getMessage();
//         this.status = -1;
//         this.code = -1;
//     }
// 
//     public int status() {
//         return status;
//     }
// 
//     /**
//      * @return an end-user error message
//      */
//     public String message() {
//         return message;
//     }
// 
//     public int code() {
//         return code;
//     }
// 
//     public String developerMessage() {
//         return developerMessage;
//     }
// 
//     public String moreInfo() {
//         return moreInfo;
//     }
// 
//     /**
//      * @return the throwable which caused the error, or null if the error was returned by the API
//      */
//     @Nullable
//     public Throwable throwable() {
//         return throwable;
//     }
// }


// Path: sdk/src/test/java/com/stormpath/sdk/SocialProvidersTest.java
import com.stormpath.sdk.models.AccountStore;
import com.stormpath.sdk.models.LoginModel;
import com.stormpath.sdk.models.StormpathError;
import org.junit.Test;
import java.net.HttpURLConnection;
import okhttp3.mockwebserver.RecordedRequest;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.stub;
import static org.mockito.Mockito.verify;

        enqueueResponse("stormpath-social-providers-response.json");
        StormpathCallback<LoginModel> callback = mock(StormpathCallback.class);
        Stormpath.apiManager.getLoginModel(callback);

        verify(callback).onSuccess(any(LoginModel.class));
    }

    @Test
    public void successfulFetchReturnsCorrectData() throws Exception {
        stub(mockPlatform().preferenceStore().getAccessToken()).toReturn("abcdefghijklmnopqrstuvwyxz0123456789");

        SocialProvidersCallback callback = new SocialProvidersCallback();
        enqueueResponse("stormpath-social-providers-response.json");

        Stormpath.apiManager.getLoginModel(callback);
        assertThat(callback.loginModel.getAccountStores()).hasSize(3);
        AccountStore facebook = callback.loginModel.getAccountStores().get(0);
        AccountStore google = callback.loginModel.getAccountStores().get(1);
        AccountStore linkedin = callback.loginModel.getAccountStores().get(2);

        assertThat(facebook.getProviderId()).isEqualTo("facebook");
        assertThat(facebook.getHref()).isEqualTo("1234567890123456");

        assertThat(google.getProviderId()).isEqualTo("google");
        assertThat(google.getHref()).isEqualTo("123456789012-abcdefghijklmnopqrstuwvxyz123456.apps.googleusercontent.com");

        assertThat(linkedin.getProviderId()).isEqualTo("linkedin");
        assertThat(linkedin.getHref()).isEqualTo("abcdef12345678");
    }

    @Test