use of io.divide.client.auth.credentials.SignUpCredentials in project divide by HiddenStage.
the class AuthManagerTest method testLoginASync.
@Test
public void testLoginASync() throws Exception {
SignUpCredentials signUpCredentials = new SignUpCredentials("name", "email", "");
String unEncryptedPW = signUpCredentials.getPassword();
BackendUser signInUser = authManager.signUp(signUpCredentials).get();
BackendUser user = authManager.loginASync(new LoginCredentials(signInUser.getEmailAddress(), unEncryptedPW)).toBlockingObservable().first();
assertEquals(signInUser.getUsername(), user.getUsername());
}
use of io.divide.client.auth.credentials.SignUpCredentials in project divide by HiddenStage.
the class AuthManagerTest method testSendGetUserData.
@Test
public void testSendGetUserData() throws Exception {
BackendUser user = authManager.signUp(new SignUpCredentials("name", "email", "11")).get();
user.put("key", "value");
System.out.println("BEFORE_USER: " + authManager.getUser());
System.out.println("BEFORE_ID: " + backend.getConfig().id);
// user.save();
authManager.sendUserData(user).toBlockingObservable().first();
// user.logout();
user = authManager.login(new LoginCredentials("email", "11")).get();
assertNotNull(user);
assertEquals("value", user.get(String.class, "key"));
}
use of io.divide.client.auth.credentials.SignUpCredentials in project divide by HiddenStage.
the class AuthManagerTest method testRecoverFromOneTimeToken.
@Test
public void testRecoverFromOneTimeToken() throws Exception {
SignUpResponse response = authManager.signUp(new SignUpCredentials("name", "email", ""));
BackendUser user = response.get();
assertEquals(user.getUsername(), "name");
BackendUser credentials = authManager.getUserFromRecoveryToken(user.getRecoveryToken()).toBlockingObservable().first();
assertNotNull(credentials);
assertEquals(credentials.getUsername(), "name");
}
use of io.divide.client.auth.credentials.SignUpCredentials in project divide by HiddenStage.
the class AuthManagerTest method testSignUpASync.
@Test
public void testSignUpASync() throws Exception {
BackendUser user = authManager.signUpASync(new SignUpCredentials("name", "email", "")).toBlockingObservable().first();
assertEquals(user.getUsername(), "name");
}
Aggregations