use of org.sagebionetworks.bridge.models.accounts.SignIn in project BridgeServer2 by Sage-Bionetworks.
the class CacheKeyTest method emailSignInRequest.
@Test
public void emailSignInRequest() {
SignIn signIn = new SignIn.Builder().withAppId(TEST_APP_ID).withEmail("email@email.com").build();
assertEquals(CacheKey.emailSignInRequest(signIn).toString(), "email@email.com:" + TEST_APP_ID + ":signInRequest");
}
use of org.sagebionetworks.bridge.models.accounts.SignIn in project BridgeServer2 by Sage-Bionetworks.
the class SignInValidatorTest method passwordSignInWithPhoneOK.
@Test
public void passwordSignInWithPhoneOK() {
SignIn signIn = new SignIn.Builder().withAppId(TEST_APP_ID).withPhone(TestConstants.PHONE).withPassword(PASSWORD).build();
Validate.entityThrowingException(SignInValidator.PASSWORD_SIGNIN, signIn);
}
use of org.sagebionetworks.bridge.models.accounts.SignIn in project BridgeServer2 by Sage-Bionetworks.
the class SignInValidatorTest method emailSignInOK.
@Test
public void emailSignInOK() {
SignIn signIn = new SignIn.Builder().withAppId(TEST_APP_ID).withEmail(EMAIL).withToken(TOKEN).build();
Validate.entityThrowingException(SignInValidator.EMAIL_SIGNIN, signIn);
}
use of org.sagebionetworks.bridge.models.accounts.SignIn in project BridgeServer2 by Sage-Bionetworks.
the class SignInValidatorTest method reauthWithInvalidPhoneInvalid.
@Test
public void reauthWithInvalidPhoneInvalid() {
SignIn signIn = new SignIn.Builder().withPhone(new Phone("xxxxxxxxxx", "US")).build();
assertValidatorMessage(SignInValidator.REAUTH_SIGNIN, signIn, "phone", "does not appear to be a phone number");
}
use of org.sagebionetworks.bridge.models.accounts.SignIn in project BridgeServer2 by Sage-Bionetworks.
the class SignInValidatorTest method phoneSignInRequestOK.
@Test
public void phoneSignInRequestOK() {
SignIn signIn = new SignIn.Builder().withAppId(TEST_APP_ID).withPhone(TestConstants.PHONE).build();
Validate.entityThrowingException(SignInValidator.PHONE_SIGNIN_REQUEST, signIn);
}
Aggregations