Search in sources :

Example 1 with Contact

use of org.sagebionetworks.bridge.models.studies.Contact in project BridgeServer2 by Sage-Bionetworks.

the class StudyValidatorTest method stringLengthValidation_contactJurisdiction.

@Test
public void stringLengthValidation_contactJurisdiction() {
    study = createStudy();
    Contact c1 = createContact();
    c1.setJurisdiction(generateStringOfLength(256));
    study.setContacts(ImmutableList.of(c1));
    assertValidatorMessage(validator, study, CONTACTS_FIELD + "[0]." + JURISDICTION_FIELD, getInvalidStringLengthMessage(255));
}
Also used : Contact(org.sagebionetworks.bridge.models.studies.Contact) Test(org.testng.annotations.Test)

Example 2 with Contact

use of org.sagebionetworks.bridge.models.studies.Contact in project BridgeServer2 by Sage-Bionetworks.

the class StudyValidatorTest method nullContactPhoneOK.

@Test
public void nullContactPhoneOK() {
    study = createStudy();
    Contact c1 = createContact();
    c1.setPhone(null);
    study.setContacts(ImmutableList.of(c1));
    entityThrowingException(validator, study);
}
Also used : Contact(org.sagebionetworks.bridge.models.studies.Contact) Test(org.testng.annotations.Test)

Example 3 with Contact

use of org.sagebionetworks.bridge.models.studies.Contact in project BridgeServer2 by Sage-Bionetworks.

the class StudyValidatorTest method nullContactEmailOK.

@Test
public void nullContactEmailOK() {
    study = createStudy();
    Contact c1 = createContact();
    c1.setEmail(null);
    study.setContacts(ImmutableList.of(c1));
    entityThrowingException(validator, study);
}
Also used : Contact(org.sagebionetworks.bridge.models.studies.Contact) Test(org.testng.annotations.Test)

Example 4 with Contact

use of org.sagebionetworks.bridge.models.studies.Contact in project BridgeServer2 by Sage-Bionetworks.

the class StudyValidatorTest method stringLengthValidation_contactCity.

@Test
public void stringLengthValidation_contactCity() {
    study = createStudy();
    Contact c1 = createContact();
    Address a1 = createAddress();
    a1.setCity(generateStringOfLength(256));
    c1.setAddress(a1);
    study.setContacts(ImmutableList.of(c1));
    assertValidatorMessage(validator, study, CONTACTS_FIELD + "[0]." + ADDRESS_FIELD + "." + CITY_FIELD, getInvalidStringLengthMessage(255));
}
Also used : Address(org.sagebionetworks.bridge.models.studies.Address) Contact(org.sagebionetworks.bridge.models.studies.Contact) Test(org.testng.annotations.Test)

Example 5 with Contact

use of org.sagebionetworks.bridge.models.studies.Contact in project BridgeServer2 by Sage-Bionetworks.

the class StudyValidatorTest method stringLengthValidation_contactStreet.

@Test
public void stringLengthValidation_contactStreet() {
    study = createStudy();
    Contact c1 = createContact();
    Address a1 = createAddress();
    a1.setStreet(generateStringOfLength(256));
    c1.setAddress(a1);
    study.setContacts(ImmutableList.of(c1));
    assertValidatorMessage(validator, study, CONTACTS_FIELD + "[0]." + ADDRESS_FIELD + "." + STREET_FIELD, getInvalidStringLengthMessage(255));
}
Also used : Address(org.sagebionetworks.bridge.models.studies.Address) Contact(org.sagebionetworks.bridge.models.studies.Contact) Test(org.testng.annotations.Test)

Aggregations

Contact (org.sagebionetworks.bridge.models.studies.Contact)23 Test (org.testng.annotations.Test)20 Address (org.sagebionetworks.bridge.models.studies.Address)9 Phone (org.sagebionetworks.bridge.models.accounts.Phone)2 Study (org.sagebionetworks.bridge.models.studies.Study)2 StudyCustomEvent (org.sagebionetworks.bridge.models.studies.StudyCustomEvent)2 DateTimeException (java.time.DateTimeException)1 HashSet (java.util.HashSet)1 UnauthorizedException (org.sagebionetworks.bridge.exceptions.UnauthorizedException)1 StudyActivityEventIdsMap (org.sagebionetworks.bridge.models.activities.StudyActivityEventIdsMap)1 Schedule2 (org.sagebionetworks.bridge.models.schedules2.Schedule2)1