summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/CentralUserTest.java
blob: 9df86bc93a7ed55db1262075ece967836bf5c3fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package org.openecomp.portalapp.portal.transport;

import static org.junit.Assert.*;

import java.util.HashSet;
import java.util.Set;

import org.junit.Test;
import org.openecomp.portalapp.portal.transport.CentralRole;
import org.openecomp.portalapp.portal.transport.CentralUser;
import org.openecomp.portalapp.portal.transport.CentralUserApp;

public class CentralUserTest {

	public CentralUser mockCentralUser(){
		Set<CentralUserApp> userApps = new HashSet<CentralUserApp>();
		Set<CentralRole> pseudoRoles = new HashSet<CentralRole>();
		CentralUser centralUser = new CentralUser((long)1, null, null, (long)1, (long)1, (long)1, (long)1,
				(long)1, "test", "test", "test", "test", "test",
				"test", "test", (long)1, "test", "test", "test",
				"test", "test", "test", "test", "test", "test", "test",
				"test", "test", "test", "test",
				"test", "test", "test", "test", "test",
				"test", "test", "test", "test", "test",
				"test", "test", "test", "test", null,
				false, false, (long)1, (long)1, false, "test", userApps, pseudoRoles);
		
		return centralUser;
	}
	
	@Test
	public void centralRoleTest(){
		CentralUser centralUser = mockCentralUser();
		
		Set<CentralUserApp> userApps = new HashSet<CentralUserApp>();
		Set<CentralRole> pseudoRoles = new HashSet<CentralRole>();
		CentralUser centralUser1 = new CentralUser((long)1, null, null, (long)1, (long)1, (long)1, (long)1,
				(long)1, "test", "test", "test", "test", "test",
				"test", "test", (long)1, "test", "test", "test",
				"test", "test", "test", "test", "test", "test", "test",
				"test", "test", "test", "test",
				"test", "test", "test", "test", "test",
				"test", "test", "test", "test", "test",
				"test", "test", "test", "test", null,
				false, false, (long)1, (long)1, false, "test", userApps, pseudoRoles);
		
		
		assertEquals(centralUser, centralUser1);
		assertEquals(centralUser.hashCode(), centralUser1.hashCode());
		assertTrue(centralUser.equals(centralUser1));
	}
}