Package gwtappcontainer.shared.apps.insight.Member

Examples of gwtappcontainer.shared.apps.insight.Member.ContactDetails


  @Test
  public void updateManyContactDetailsTest() {   
    Center sgp = CenterRepository.add("singapore");
   
    List<ContactDetails> contactDetailsList = new ArrayList<>();
    ContactDetails contactDetails1 = new ContactDetails();
    contactDetails1.email = "sathya.t@ishafoundation.org";
    contactDetails1.firstName = "sathyanarayanan";
    contactDetails1.lastName = "thilakan";
    contactDetails1.phone = "+6598361844";
    contactDetails1.officeAddress = "one raffles quay";
    contactDetailsList.add(contactDetails1);
   
    ContactDetails contactDetails2 = new ContactDetails();
    contactDetails2.email = "ramya.c@ishafoundation.org";
    contactDetails2.firstName = "ramya";
    contactDetails2.lastName = "chidambaram";   
    contactDetailsList.add(contactDetails2);
   
    ContactDetails contactDetails3 = new ContactDetails();
    contactDetails3.email = "thulasidhar@gmail.com";
    contactDetails3.firstName = "thulasidhar";
    contactDetails3.phone = "+6592705371"
    contactDetailsList.add(contactDetails3);
   
View Full Code Here


    }   
  }
 
  @Test
  public void applyChangesTest() {
    ContactDetails contactDetails = new ContactDetails();
    contactDetails.email = "sathya.isha@gmail.com";
    contactDetails.firstName = "sathya";
    contactDetails.lastName = "thilakan";
    contactDetails.phone = "+6598361844";
    contactDetails.homeAddress = "block 292b";
   
    ContactDetails changes = new ContactDetails();
    changes.email = "sathya.t@ishafoundation.org";
    changes.middleName = "narayanan";
    changes.officeAddress = "level 28, one raffles quay";
   
    contactDetails = MemberRepository.applyChanges(contactDetails, changes);     
View Full Code Here

  }
 
  @Test
  public void addOrUpdateManyTest() {
    Center sgp = CenterRepository.add("singapore");
    ContactDetails contactDetails = new ContactDetails();
    contactDetails.email = "sathya.t@ishafoundation.org";
    contactDetails.firstName = "sathya";
    MemberRepository.add(contactDetails, sgp.id, SUPER_USER);
       
    contactDetails.email = "thulasidhar@gmail.com";
    contactDetails.firstName = "thulasi";
    MemberRepository.add(contactDetails, sgp.id, SUPER_USER);
   
    List<ContactDetails> contactDetailslList = new ArrayList<>();
    ContactDetails c1 = new ContactDetails();
    c1.email = "isha.srividhya@gmail.com";
    c1.firstName = "srividhya";
    c1.lastName = "radhakrishnan";
    contactDetailslList.add(c1);
   
    ContactDetails c2 = new ContactDetails();
    c2.email = "isha.vijay@gmail.com";
    c2.firstName = "vijaykumar";
    c2.lastName = "krishnamurthy";
    contactDetailslList.add(c2);
   
    ContactDetails c3 = new ContactDetails();
    c3.email = "sathya.t@ishafoundation.org";
    c3.lastName = "thilakan";
    contactDetailslList.add(c3);
   
    ContactDetails c4 = new ContactDetails();
    c4.email = "thulasidhar@gmail.com";
    c4.firstName = "thulasidhar";
    c4.lastName = "kosalram";
    contactDetailslList.add(c4);
   
    MemberRepository.addOrUpdateMany(sgp.id, contactDetailslList, USER_WITH_EDITMEMBER_PRIVILEGE);
    Member member = MemberRepository.get("sathya.t@ishafoundation.org", SUPER_USER);
    assertTrue(member != null);
    assertTrue(member.contactDetails.email.equals("sathya.t@ishafoundation.org"));
    assertTrue(member.contactDetails.firstName.equals("sathya"));
    assertTrue(member.contactDetails.lastName.equals("thilakan"));
   
    member = MemberRepository.get("thulasidhar@gmail.com", SUPER_USER);
    assertTrue(member != null);
    assertTrue(member.contactDetails.email.equals("thulasidhar@gmail.com"));
    assertTrue(member.contactDetails.firstName.equals("thulasidhar"));
    assertTrue(member.contactDetails.lastName.equals("kosalram"));
   
    member = MemberRepository.get("isha.srividhya@gmail.com", SUPER_USER);
    assertTrue(member != null);
    assertTrue(member.contactDetails.email.equals("isha.srividhya@gmail.com"));
    assertTrue(member.contactDetails.firstName.equals("srividhya"));
    assertTrue(member.contactDetails.lastName.equals("radhakrishnan"));
   
    member = MemberRepository.get("isha.vijay@gmail.com", SUPER_USER);
    assertTrue(member != null);
    assertTrue(member.contactDetails.email.equals("isha.vijay@gmail.com"));
    assertTrue(member.contactDetails.firstName.equals("vijaykumar"));
    assertTrue(member.contactDetails.lastName.equals("krishnamurthy"));
   
    //privilege required
    try {
      MemberRepository.addOrUpdateMany(sgp.id, contactDetailslList, VALID_USER);
    } catch (APIException ex) {
      assertTrue(ex.statusCode == Status.ERROR_INSUFFICIENT_PERMISSION);
    }
   
    //cannot add more than limit
    for (int i = 0; i < Limits.Member.MAX_NUMRECORDS_BULKIMPORT + 1; i++) {
      ContactDetails c5 = new ContactDetails();
      c5.email = "dummy" + i + "@dummy.com";
      contactDetailslList.add(c5);   
    }
    try {
      MemberRepository.addOrUpdateMany(sgp.id, contactDetailslList, USER_WITH_EDITMEMBER_PRIVILEGE);
View Full Code Here

TOP

Related Classes of gwtappcontainer.shared.apps.insight.Member.ContactDetails

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.