- private void newApplicant() throws IOException {
- applicantM = createUniqueName() + "@example.com";
- int applicantId = createVerifiedUser("John", "Doe", applicantM, TEST_PASSWORD);
- cookieApplicant = login(applicantM, TEST_PASSWORD);
- executeBasicWebInteraction(cookieApplicant, MyDetails.PATH, "fname=James&lname=Doe&action=addName", 0);
- executeBasicWebInteraction(cookieApplicant, MyDetails.PATH, "fname=James+John&lname=Doe&action=addName", 0);
- applicant = User.getById(applicantId);
- Name[] names = applicant.getNames();
- firstName = 0;
- secondName = 0;
- thirdName = 0;
- for (int i = 0; i < names.length; i++) {
- if (names[i].toString().equals("John Doe")) {
- firstName = names[i].getId();
- }
- if (names[i].toString().equals("James Doe")) {
- secondName = names[i].getId();
- }
- if (names[i].toString().equals("James John Doe")) {
- thirdName = names[i].getId();
- }
- }
- assertNotEquals(0, firstName);
- assertNotEquals(0, secondName);
- assertNotEquals(0, thirdName);
+ private void newApplicant() throws GigiApiException {
+ applicant = User.getById(createVerifiedUser("John", "Doe", createUniqueName() + "@example.com", TEST_PASSWORD));
+ firstName = applicant.getPreferredName();
+ secondName = new Name(applicant, new NamePart(NamePartType.FIRST_NAME, "James"), new NamePart(NamePartType.LAST_NAME, "Doe"));
+ thirdName = new Name(applicant, new NamePart(NamePartType.FIRST_NAME, "James"), new NamePart(NamePartType.FIRST_NAME, "John"), new NamePart(NamePartType.LAST_NAME, "Doe"));