Search in sources :

Example 6 with SignIn

use of org.sagebionetworks.bridge.models.accounts.SignIn in project BridgeServer2 by Sage-Bionetworks.

the class SignInValidatorTest method reauthWithEmailOK.

@Test
public void reauthWithEmailOK() {
    SignIn signIn = new SignIn.Builder().withAppId(TEST_APP_ID).withEmail(EMAIL).withReauthToken(REAUTH_TOKEN).build();
    Validate.entityThrowingException(SignInValidator.REAUTH_SIGNIN, signIn);
}
Also used : SignIn(org.sagebionetworks.bridge.models.accounts.SignIn) Test(org.testng.annotations.Test)

Example 7 with SignIn

use of org.sagebionetworks.bridge.models.accounts.SignIn in project BridgeServer2 by Sage-Bionetworks.

the class SignInValidatorTest method phoneSignInOK.

@Test
public void phoneSignInOK() {
    SignIn signIn = new SignIn.Builder().withAppId(TEST_APP_ID).withPhone(TestConstants.PHONE).withToken(TOKEN).build();
    Validate.entityThrowingException(SignInValidator.PHONE_SIGNIN, signIn);
}
Also used : SignIn(org.sagebionetworks.bridge.models.accounts.SignIn) Test(org.testng.annotations.Test)

Example 8 with SignIn

use of org.sagebionetworks.bridge.models.accounts.SignIn in project BridgeServer2 by Sage-Bionetworks.

the class SignInValidatorTest method passwordSignInWithEmailOK.

@Test
public void passwordSignInWithEmailOK() {
    SignIn signIn = new SignIn.Builder().withAppId(TEST_APP_ID).withEmail(EMAIL).withPassword(PASSWORD).build();
    Validate.entityThrowingException(SignInValidator.PASSWORD_SIGNIN, signIn);
}
Also used : SignIn(org.sagebionetworks.bridge.models.accounts.SignIn) Test(org.testng.annotations.Test)

Example 9 with SignIn

use of org.sagebionetworks.bridge.models.accounts.SignIn in project BridgeServer2 by Sage-Bionetworks.

the class SignInValidatorTest method minimalOK.

@Test
public void minimalOK() {
    SignIn signIn = new SignIn.Builder().withAppId(TEST_APP_ID).withEmail(EMAIL).build();
    Validate.entityThrowingException(SignInValidator.MINIMAL, signIn);
    signIn = new SignIn.Builder().withAppId(TEST_APP_ID).withPhone(TestConstants.PHONE).build();
    Validate.entityThrowingException(SignInValidator.MINIMAL, signIn);
}
Also used : SignIn(org.sagebionetworks.bridge.models.accounts.SignIn) Test(org.testng.annotations.Test)

Example 10 with SignIn

use of org.sagebionetworks.bridge.models.accounts.SignIn in project BridgeServer2 by Sage-Bionetworks.

the class SignInValidatorTest method passwordSignInWithEmailAndPhoneInvalid.

@Test
public void passwordSignInWithEmailAndPhoneInvalid() {
    SignIn signIn = new SignIn.Builder().withEmail(EMAIL).withPhone(TestConstants.PHONE).build();
    assertValidatorMessage(SignInValidator.PASSWORD_SIGNIN, signIn, "SignIn", "only provide one of email, phone, or external ID");
}
Also used : SignIn(org.sagebionetworks.bridge.models.accounts.SignIn) Test(org.testng.annotations.Test)

Aggregations

SignIn (org.sagebionetworks.bridge.models.accounts.SignIn)79 Test (org.testng.annotations.Test)61 App (org.sagebionetworks.bridge.models.apps.App)15 IdentifierUpdate (org.sagebionetworks.bridge.models.accounts.IdentifierUpdate)14 CriteriaContext (org.sagebionetworks.bridge.models.CriteriaContext)13 StatusMessage (org.sagebionetworks.bridge.models.StatusMessage)12 Account (org.sagebionetworks.bridge.models.accounts.Account)10 PostMapping (org.springframework.web.bind.annotation.PostMapping)9 Phone (org.sagebionetworks.bridge.models.accounts.Phone)7 UserSession (org.sagebionetworks.bridge.models.accounts.UserSession)7 JsonNode (com.fasterxml.jackson.databind.JsonNode)5 DateRangeResourceList (org.sagebionetworks.bridge.models.DateRangeResourceList)5 StudyParticipant (org.sagebionetworks.bridge.models.accounts.StudyParticipant)5 HealthDataSubmission (org.sagebionetworks.bridge.models.healthdata.HealthDataSubmission)5 ReportData (org.sagebionetworks.bridge.models.reports.ReportData)5 RequestContext (org.sagebionetworks.bridge.RequestContext)4 BadRequestException (org.sagebionetworks.bridge.exceptions.BadRequestException)4 ConsentRequiredException (org.sagebionetworks.bridge.exceptions.ConsentRequiredException)4 UnauthorizedException (org.sagebionetworks.bridge.exceptions.UnauthorizedException)3 ResponseStatus (org.springframework.web.bind.annotation.ResponseStatus)3