Search in sources :

Example 1 with SignUpResponse

use of io.divide.client.auth.SignUpResponse in project divide by HiddenStage.

the class DataManagerTest method testSend.

@Test
public void testSend() throws Exception {
    SignUpResponse response = authManager.signUp(new SignUpCredentials("name", "email", ""));
    assertEquals(response.get().getUsername(), "name");
    BackendServices.remote().save(new BackendObject()).toBlockingObservable();
}
Also used : SignUpResponse(io.divide.client.auth.SignUpResponse) SignUpCredentials(io.divide.client.auth.credentials.SignUpCredentials) BackendObject(io.divide.client.BackendObject) ClientTest(io.divide.client.ClientTest) Test(org.junit.Test)

Example 2 with SignUpResponse

use of io.divide.client.auth.SignUpResponse in project divide by HiddenStage.

the class BackendUser method signUp.

/**
     * Synchronously sign up using credentials provided via constructor or setters.
     * @return boolean indicating sign up success
     */
public boolean signUp() {
    SignUpCredentials creds = new SignUpCredentials(getUsername(), getEmailAddress(), getPassword());
    SignUpResponse response = getAM().signUp(creds);
    if (response.getStatus().isSuccess()) {
        this.initFrom(response.get());
        return true;
    } else
        return false;
}
Also used : SignUpResponse(io.divide.client.auth.SignUpResponse) SignUpCredentials(io.divide.client.auth.credentials.SignUpCredentials)

Aggregations

SignUpResponse (io.divide.client.auth.SignUpResponse)2 SignUpCredentials (io.divide.client.auth.credentials.SignUpCredentials)2 BackendObject (io.divide.client.BackendObject)1 ClientTest (io.divide.client.ClientTest)1 Test (org.junit.Test)1