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