Search in sources :

Example 76 with SignIn

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

the class SignInValidatorTest method requestResetPasswordOK.

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

Example 77 with SignIn

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

the class SignInValidatorTest method reauthWithPhoneOK.

@Test
public void reauthWithPhoneOK() {
    SignIn signIn = new SignIn.Builder().withAppId(TEST_APP_ID).withPhone(TestConstants.PHONE).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 78 with SignIn

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

the class SignInValidatorTest method blankExternalIdSignInInvalid.

@Test
public void blankExternalIdSignInInvalid() {
    SignIn signIn = new SignIn.Builder().withAppId(TEST_APP_ID).withExternalId("").build();
    assertValidatorMessage(SignInValidator.MINIMAL, signIn, "SignIn", "email, phone, or external ID is required");
}
Also used : SignIn(org.sagebionetworks.bridge.models.accounts.SignIn) Test(org.testng.annotations.Test)

Example 79 with SignIn

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

the class SignInValidatorTest method reauthWithEmailAndPhoneInvalid.

@Test
public void reauthWithEmailAndPhoneInvalid() {
    SignIn signIn = new SignIn.Builder().withEmail(EMAIL).withPhone(TestConstants.PHONE).build();
    assertValidatorMessage(SignInValidator.REAUTH_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