f35826471da39f83c00bdda8ae6b05420c4a4c4f
[portal.git] / ecomp-portal-BE-common / src / test / java / org / openecomp / portalapp / portal / transport / CentralUserAppTest.java
1 package org.openecomp.portalapp.portal.transport;
2
3 import static org.junit.Assert.assertEquals;
4 import org.junit.Test;
5 import org.openecomp.portalapp.portal.transport.CentralApp;
6 import org.openecomp.portalapp.portal.transport.CentralRole;
7 import org.openecomp.portalapp.portal.transport.CentralUserApp;
8
9 public class CentralUserAppTest {
10
11         public CentralUserApp mockCentralUserApp(){
12                 CentralUserApp centralUserApp = new CentralUserApp();
13                                 
14                 CentralApp app = new CentralApp((long)1, null, null, (long)1, (long)1, (long)1, "test", "test", "test", "test", "test", "test", "test", "test", "test", 
15                                 "test", "test", "test", "test", null, "test", "test", "test", "test");
16                 
17                 CentralRole role = new CentralRole();
18                  
19                 centralUserApp.setUserId((long)1);
20                 centralUserApp.setApp(app);
21                 centralUserApp.setRole(role);
22                 centralUserApp.setPriority((short) 123);
23                 
24                 return centralUserApp;
25         }
26         
27         @Test
28         public void centralUserAppTest(){
29                 CentralUserApp centralUserApp = mockCentralUserApp();
30                 
31                 CentralApp app1 = new CentralApp((long)1, null, null, (long)1, (long)1, (long)1, "test", "test", "test", "test", "test", "test", "test", "test", "test", 
32                                 "test", "test", "test", "test", null, "test", "test", "test", "test");
33                 
34                 CentralRole role1 = new CentralRole();
35                 
36                 assertEquals(centralUserApp.getUserId(), new Long(1));
37                 assertEquals(centralUserApp.getPriority(), new Short((short) 123));
38                 assertEquals(centralUserApp.getApp(), app1);
39                 assertEquals(centralUserApp.getRole(), role1);
40         }
41 }