9df86bc93a7ed55db1262075ece967836bf5c3fc
[portal.git] / ecomp-portal-BE-common / src / test / java / org / openecomp / portalapp / portal / transport / CentralUserTest.java
1 package org.openecomp.portalapp.portal.transport;
2
3 import static org.junit.Assert.*;
4
5 import java.util.HashSet;
6 import java.util.Set;
7
8 import org.junit.Test;
9 import org.openecomp.portalapp.portal.transport.CentralRole;
10 import org.openecomp.portalapp.portal.transport.CentralUser;
11 import org.openecomp.portalapp.portal.transport.CentralUserApp;
12
13 public class CentralUserTest {
14
15         public CentralUser mockCentralUser(){
16                 Set<CentralUserApp> userApps = new HashSet<CentralUserApp>();
17                 Set<CentralRole> pseudoRoles = new HashSet<CentralRole>();
18                 CentralUser centralUser = new CentralUser((long)1, null, null, (long)1, (long)1, (long)1, (long)1,
19                                 (long)1, "test", "test", "test", "test", "test",
20                                 "test", "test", (long)1, "test", "test", "test",
21                                 "test", "test", "test", "test", "test", "test", "test",
22                                 "test", "test", "test", "test",
23                                 "test", "test", "test", "test", "test",
24                                 "test", "test", "test", "test", "test",
25                                 "test", "test", "test", "test", null,
26                                 false, false, (long)1, (long)1, false, "test", userApps, pseudoRoles);
27                 
28                 return centralUser;
29         }
30         
31         @Test
32         public void centralRoleTest(){
33                 CentralUser centralUser = mockCentralUser();
34                 
35                 Set<CentralUserApp> userApps = new HashSet<CentralUserApp>();
36                 Set<CentralRole> pseudoRoles = new HashSet<CentralRole>();
37                 CentralUser centralUser1 = new CentralUser((long)1, null, null, (long)1, (long)1, (long)1, (long)1,
38                                 (long)1, "test", "test", "test", "test", "test",
39                                 "test", "test", (long)1, "test", "test", "test",
40                                 "test", "test", "test", "test", "test", "test", "test",
41                                 "test", "test", "test", "test",
42                                 "test", "test", "test", "test", "test",
43                                 "test", "test", "test", "test", "test",
44                                 "test", "test", "test", "test", null,
45                                 false, false, (long)1, (long)1, false, "test", userApps, pseudoRoles);
46                 
47                 
48                 assertEquals(centralUser, centralUser1);
49                 assertEquals(centralUser.hashCode(), centralUser1.hashCode());
50                 assertTrue(centralUser.equals(centralUser1));
51         }
52 }