Update license; improve coverage; add docs dir
[portal.git] / ecomp-portal-BE-common / src / test / java / org / openecomp / portalapp / portal / domain / EPUserTest.java
1 /*-
2  * ============LICENSE_START==========================================
3  * ONAP Portal
4  * ===================================================================
5  * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6  * ===================================================================
7  *
8  * Unless otherwise specified, all software contained herein is licensed
9  * under the Apache License, Version 2.0 (the “License”);
10  * you may not use this software except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *             http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * Unless otherwise specified, all documentation contained herein is licensed
22  * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
23  * you may not use this documentation except in compliance with the License.
24  * You may obtain a copy of the License at
25  *
26  *             https://creativecommons.org/licenses/by/4.0/
27  *
28  * Unless required by applicable law or agreed to in writing, documentation
29  * distributed under the License is distributed on an "AS IS" BASIS,
30  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31  * See the License for the specific language governing permissions and
32  * limitations under the License.
33  *
34  * ============LICENSE_END============================================
35  *
36  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
37  */
38 package org.openecomp.portalapp.portal.domain;
39
40 import static org.junit.Assert.assertEquals;
41
42 import java.util.Date;
43
44 import org.junit.Test;
45 import org.openecomp.portalapp.portal.domain.EPUser;
46
47 public class EPUserTest {
48
49         public EPUser mockEPUser(){
50                 
51                 EPUser epUser = new EPUser();
52                 
53                 epUser.setId((long)1);
54                 epUser.setManagerId((long) 1234);
55                 epUser.setFirstName("test");
56                 epUser.setLastName("test");
57                 epUser.setMiddleInitial("test");
58                 epUser.setPhone("test");
59                 epUser.setFax("test");
60                 epUser.setCellular("test");
61                 epUser.setEmail("test");
62                 epUser.setAddressId((long) 123); 
63                 epUser.setAlertMethodCd("test");
64                 epUser.setHrid("test");
65                 epUser.setOrgUserId("test");
66                 epUser.setOrgCode("test");
67                 epUser.setAddress1("test");
68                 epUser.setAddress2("test");
69                 epUser.setCity("test");
70                 epUser.setState("test");
71                 epUser.setZipCode("test");
72                 epUser.setCountry("test");
73                 epUser.setOrgManagerUserId("test");
74                 epUser.setLocationClli("test");
75                 epUser.setBusinessCountryCode("test");
76                 epUser.setBusinessCountryName("test");
77                 epUser.setBusinessUnit("test");
78                 epUser.setBusinessUnitName("test");
79                 epUser.setDepartment("test");
80                 epUser.setDepartmentName("test");
81                 epUser.setCompanyCode("test");
82                 epUser.setCompany("test");
83                 epUser.setZipCodeSuffix("test");
84                 epUser.setJobTitle("test");
85                 epUser.setCommandChain("test");
86                 epUser.setSiloStatus("test");
87                 epUser.setCostCenter("test");
88                 epUser.setFinancialLocCode("test");
89                 epUser.setLoginId("test");
90                 epUser.setLoginPwd("test");
91                 epUser.setLastLoginDate(new Date());
92                 epUser.setActive(false);
93                 epUser.setInternal(false);
94                 epUser.setSelectedProfileId((long) 12345);
95                 epUser.setTimeZoneId((long) 12345);
96                 epUser.setOnline(false);
97                 epUser.setChatId("test");
98                 return epUser;
99                                     
100         }
101         
102         @Test
103         public void userTest(){
104                 EPUser user = mockEPUser();
105                 
106                 assertEquals(user.getId(), new Long(1));
107                 assertEquals(user.getManagerId(), new Long(1234));
108                 assertEquals(user.getFirstName(), "test");
109                 assertEquals(user.getLastName(), "test");
110                 assertEquals(user.getMiddleInitial(), "test");
111                 assertEquals(user.getPhone(), "test");
112                 assertEquals(user.getFax(), "test");
113                 assertEquals(user.getCellular(), "test");               
114                 assertEquals(user.getEmail(), "test");
115                 assertEquals(user.getAddressId(), new Long(123) );
116                 assertEquals(user.getAlertMethodCd(), "test");
117                 assertEquals(user.getHrid(), "test");
118                 assertEquals(user.getOrgUserId(), "test");
119                 assertEquals(user.getOrgCode(), "test");
120                 assertEquals(user.getAddress1(), "test");
121                 assertEquals(user.getAddress2(), "test");
122                 assertEquals(user.getState(), "test");
123                 assertEquals(user.getZipCode(), "test");
124                 assertEquals(user.getCountry(), "test");
125                 assertEquals(user.getOrgManagerUserId(), "test");
126                 assertEquals(user.getLocationClli(), "test");
127                 assertEquals(user.getBusinessCountryCode(), "test");
128                 assertEquals(user.getBusinessCountryName(), "test");
129                 assertEquals(user.getBusinessUnit(), "test");
130                 assertEquals(user.getBusinessUnitName(), "test");
131                 assertEquals(user.getDepartment(), "test");
132                 assertEquals(user.getDepartmentName(), "test");
133                 assertEquals(user.getCompanyCode(), "test");
134                 assertEquals(user.getCompany(), "test");
135                 assertEquals(user.getZipCodeSuffix(), "test");
136                 assertEquals(user.getJobTitle(), "test");
137                 assertEquals(user.getCommandChain(), "test");
138                 assertEquals(user.getSiloStatus(), "test");
139                 assertEquals(user.getFinancialLocCode(), "test");
140                 assertEquals(user.getLoginId(), "test");
141                 assertEquals(user.getLoginPwd(), "test");
142                 assertEquals(user.getActive(), false);
143                 assertEquals(user.getInternal(), false);
144                 assertEquals(user.getSelectedProfileId(), new Long (12345));
145                 assertEquals(user.getTimeZoneId(), new Long (12345));
146                 assertEquals(user.getChatId(), "test");
147                 
148                 //assertEquals(user.toString(), "EPUser [orgId=null, managerId=1234, firstName=test, middleInitial=test, lastName=test, phone=test, fax=test, cellular=test, email=test, addressId=123, alertMethodCd=test, hrid=test, orgUserId=test, orgCode=test, address1=test, address2=test, city=test, state=test, zipCode=test, country=test, orgManagerUserId=test, locationClli=test, businessCountryCode=test, businessCountryName=test, businessUnit=test, businessUnitName=test, department=test, departmentName=test, companyCode=test, company=test, zipCodeSuffix=test, jobTitle=test, commandChain=test, siloStatus=test, costCenter=test, financialLocCode=test, loginId=test, loginPwd=test, lastLoginDate=Tue Sep 05 11:04:49 EDT 2017, active=false, internal=false, selectedProfileId=12345, timeZoneId=12345, online=false, chatId=test, isGuest=false, userApps=[], pseudoRoles=[]]");
149         }
150         
151 }