]> WPIA git - gigi.git/blob - tests/org/cacert/gigi/dbObjects/TestAssureName.java
add: country information where verification took place
[gigi.git] / tests / org / cacert / gigi / dbObjects / TestAssureName.java
1 package org.cacert.gigi.dbObjects;
2
3 import static org.junit.Assert.*;
4
5 import org.cacert.gigi.GigiApiException;
6 import org.cacert.gigi.dbObjects.Assurance.AssuranceType;
7 import org.cacert.gigi.dbObjects.CountryCode.CountryCodeType;
8 import org.cacert.gigi.dbObjects.NamePart.NamePartType;
9 import org.cacert.gigi.testUtils.ClientBusinessTest;
10 import org.cacert.gigi.util.Notary;
11 import org.junit.Test;
12
13 public class TestAssureName extends ClientBusinessTest {
14
15     @Test
16     public void testIt() throws GigiApiException {
17         User u0 = User.getById(createAssuranceUser("f", "l", createUniqueName() + "@email.com", TEST_PASSWORD));
18         Name n2 = new Name(u, new NamePart(NamePartType.SINGLE_NAME, "Testiaa"));
19         Name n3 = new Name(u, new NamePart(NamePartType.SINGLE_NAME, "Testiaa"));
20         Name n4 = new Name(u, new NamePart(NamePartType.SINGLE_NAME, "Testiaac"));
21
22         assertEquals(0, n0.getAssurancePoints());
23         Notary.assure(u0, u, n0, u.getDoB(), 10, "test mgr", validVerificationDateString(), AssuranceType.FACE_TO_FACE, CountryCode.getCountryCode("DE", CountryCodeType.CODE_2_CHARS));
24         assertEquals(10, n0.getAssurancePoints());
25         Notary.assure(u0, u, n2, u.getDoB(), 10, "test mgr", validVerificationDateString(), AssuranceType.FACE_TO_FACE, CountryCode.getCountryCode("DE", CountryCodeType.CODE_2_CHARS));
26         assertEquals(10, n2.getAssurancePoints());
27         Notary.assure(u0, u, n3, u.getDoB(), 10, "test mgr", validVerificationDateString(), AssuranceType.FACE_TO_FACE, CountryCode.getCountryCode("DE", CountryCodeType.CODE_2_CHARS));
28         assertEquals(10, n3.getAssurancePoints());
29         Notary.assure(u0, u, n4, u.getDoB(), 10, "test mgr", validVerificationDateString(), AssuranceType.FACE_TO_FACE, CountryCode.getCountryCode("DE", CountryCodeType.CODE_2_CHARS));
30         assertEquals(10, n4.getAssurancePoints());
31         assertEquals(10, u.getMaxAssurePoints());
32     }
33 }