summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-BE-common/src
diff options
context:
space:
mode:
authorManoop Talasila <talasila@research.att.com>2018-10-09 19:20:10 +0000
committerGerrit Code Review <gerrit@onap.org>2018-10-09 19:20:10 +0000
commit71c3cf6ce33b14c0b19891979e4e2aad0452ff4e (patch)
tree8a5450852ed13023a1b6e04e01e840ce5e8013d7 /ecomp-portal-BE-common/src
parent790c57c6d82ebc4c167d5a2e4251c372d74e5ead (diff)
parenta248ec163d9d1915cc4cb0324a87a5b600803987 (diff)
Merge "test covered for comparetTo method in EPUser.java"
Diffstat (limited to 'ecomp-portal-BE-common/src')
-rw-r--r--ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserTest.java213
1 files changed, 110 insertions, 103 deletions
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserTest.java
index bc4c6f38..c856b5a3 100644
--- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserTest.java
+++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserTest.java
@@ -4,6 +4,8 @@
* ===================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ===================================================================
+ * Modifications Copyright © 2018 IBM.
+ * ================================================================================
*
* Unless otherwise specified, all software contained herein is licensed
* under the Apache License, Version 2.0 (the "License");
@@ -37,7 +39,7 @@
*/
package org.onap.portalapp.portal.domain;
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.*;
import java.util.Date;
@@ -46,106 +48,111 @@ import org.onap.portalapp.portal.domain.EPUser;
public class EPUserTest {
- public EPUser mockEPUser(){
-
- EPUser epUser = new EPUser();
-
- epUser.setId((long)1);
- epUser.setManagerId((long) 1234);
- epUser.setFirstName("test");
- epUser.setLastName("test");
- epUser.setMiddleInitial("test");
- epUser.setPhone("test");
- epUser.setFax("test");
- epUser.setCellular("test");
- epUser.setEmail("test");
- epUser.setAddressId((long) 123);
- epUser.setAlertMethodCd("test");
- epUser.setHrid("test");
- epUser.setOrgUserId("test");
- epUser.setOrgCode("test");
- epUser.setAddress1("test");
- epUser.setAddress2("test");
- epUser.setCity("test");
- epUser.setState("test");
- epUser.setZipCode("test");
- epUser.setCountry("test");
- epUser.setOrgManagerUserId("test");
- epUser.setLocationClli("test");
- epUser.setBusinessCountryCode("test");
- epUser.setBusinessCountryName("test");
- epUser.setBusinessUnit("test");
- epUser.setBusinessUnitName("test");
- epUser.setDepartment("test");
- epUser.setDepartmentName("test");
- epUser.setCompanyCode("test");
- epUser.setCompany("test");
- epUser.setZipCodeSuffix("test");
- epUser.setJobTitle("test");
- epUser.setCommandChain("test");
- epUser.setSiloStatus("test");
- epUser.setCostCenter("test");
- epUser.setFinancialLocCode("test");
- epUser.setLoginId("test");
- epUser.setLoginPwd("test");
- epUser.setLastLoginDate(new Date());
- epUser.setActive(false);
- epUser.setInternal(false);
- epUser.setSelectedProfileId((long) 12345);
- epUser.setTimeZoneId((long) 12345);
- epUser.setOnline(false);
- epUser.setChatId("test");
- return epUser;
-
- }
-
- @Test
- public void userTest(){
- EPUser user = mockEPUser();
-
- assertEquals(user.getId(), new Long(1));
- assertEquals(user.getManagerId(), new Long(1234));
- assertEquals(user.getFirstName(), "test");
- assertEquals(user.getLastName(), "test");
- assertEquals(user.getMiddleInitial(), "test");
- assertEquals(user.getPhone(), "test");
- assertEquals(user.getFax(), "test");
- assertEquals(user.getCellular(), "test");
- assertEquals(user.getEmail(), "test");
- assertEquals(user.getAddressId(), new Long(123) );
- assertEquals(user.getAlertMethodCd(), "test");
- assertEquals(user.getHrid(), "test");
- assertEquals(user.getOrgUserId(), "test");
- assertEquals(user.getOrgCode(), "test");
- assertEquals(user.getAddress1(), "test");
- assertEquals(user.getAddress2(), "test");
- assertEquals(user.getState(), "test");
- assertEquals(user.getZipCode(), "test");
- assertEquals(user.getCountry(), "test");
- assertEquals(user.getOrgManagerUserId(), "test");
- assertEquals(user.getLocationClli(), "test");
- assertEquals(user.getBusinessCountryCode(), "test");
- assertEquals(user.getBusinessCountryName(), "test");
- assertEquals(user.getBusinessUnit(), "test");
- assertEquals(user.getBusinessUnitName(), "test");
- assertEquals(user.getDepartment(), "test");
- assertEquals(user.getDepartmentName(), "test");
- assertEquals(user.getCompanyCode(), "test");
- assertEquals(user.getCompany(), "test");
- assertEquals(user.getZipCodeSuffix(), "test");
- assertEquals(user.getJobTitle(), "test");
- assertEquals(user.getCommandChain(), "test");
- assertEquals(user.getSiloStatus(), "test");
- assertEquals(user.getFinancialLocCode(), "test");
- assertEquals(user.getLoginId(), "test");
- assertEquals(user.getLoginPwd(), "test");
- assertEquals(user.getActive(), false);
- assertEquals(user.getInternal(), false);
- assertEquals(user.getSelectedProfileId(), new Long (12345));
- assertEquals(user.getTimeZoneId(), new Long (12345));
- assertEquals(user.getChatId(), "test");
-
- //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=[]]");
- }
-
+ public EPUser mockEPUser(){
+
+ EPUser epUser = new EPUser();
+
+ epUser.setId((long)1);
+ epUser.setManagerId((long) 1234);
+ epUser.setFirstName("test");
+ epUser.setLastName("test");
+ epUser.setMiddleInitial("test");
+ epUser.setPhone("test");
+ epUser.setFax("test");
+ epUser.setCellular("test");
+ epUser.setEmail("test");
+ epUser.setAddressId((long) 123);
+ epUser.setAlertMethodCd("test");
+ epUser.setHrid("test");
+ epUser.setOrgUserId("test");
+ epUser.setOrgCode("test");
+ epUser.setAddress1("test");
+ epUser.setAddress2("test");
+ epUser.setCity("test");
+ epUser.setState("test");
+ epUser.setZipCode("test");
+ epUser.setCountry("test");
+ epUser.setOrgManagerUserId("test");
+ epUser.setLocationClli("test");
+ epUser.setBusinessCountryCode("test");
+ epUser.setBusinessCountryName("test");
+ epUser.setBusinessUnit("test");
+ epUser.setBusinessUnitName("test");
+ epUser.setDepartment("test");
+ epUser.setDepartmentName("test");
+ epUser.setCompanyCode("test");
+ epUser.setCompany("test");
+ epUser.setZipCodeSuffix("test");
+ epUser.setJobTitle("test");
+ epUser.setCommandChain("test");
+ epUser.setSiloStatus("test");
+ epUser.setCostCenter("test");
+ epUser.setFinancialLocCode("test");
+ epUser.setLoginId("test");
+ epUser.setLoginPwd("test");
+ epUser.setLastLoginDate(new Date());
+ epUser.setActive(false);
+ epUser.setInternal(false);
+ epUser.setSelectedProfileId((long) 12345);
+ epUser.setTimeZoneId((long) 12345);
+ epUser.setOnline(false);
+ epUser.setChatId("test");
+ return epUser;
+
+ }
+
+ @Test
+ public void userTest(){
+ EPUser user = mockEPUser();
+
+ assertEquals(user.getId(), new Long(1));
+ assertEquals(user.getManagerId(), new Long(1234));
+ assertEquals(user.getFirstName(), "test");
+ assertEquals(user.getLastName(), "test");
+ assertEquals(user.getMiddleInitial(), "test");
+ assertEquals(user.getPhone(), "test");
+ assertEquals(user.getFax(), "test");
+ assertEquals(user.getCellular(), "test");
+ assertEquals(user.getEmail(), "test");
+ assertEquals(user.getAddressId(), new Long(123) );
+ assertEquals(user.getAlertMethodCd(), "test");
+ assertEquals(user.getHrid(), "test");
+ assertEquals(user.getOrgUserId(), "test");
+ assertEquals(user.getOrgCode(), "test");
+ assertEquals(user.getAddress1(), "test");
+ assertEquals(user.getAddress2(), "test");
+ assertEquals(user.getState(), "test");
+ assertEquals(user.getZipCode(), "test");
+ assertEquals(user.getCountry(), "test");
+ assertEquals(user.getOrgManagerUserId(), "test");
+ assertEquals(user.getLocationClli(), "test");
+ assertEquals(user.getBusinessCountryCode(), "test");
+ assertEquals(user.getBusinessCountryName(), "test");
+ assertEquals(user.getBusinessUnit(), "test");
+ assertEquals(user.getBusinessUnitName(), "test");
+ assertEquals(user.getDepartment(), "test");
+ assertEquals(user.getDepartmentName(), "test");
+ assertEquals(user.getCompanyCode(), "test");
+ assertEquals(user.getCompany(), "test");
+ assertEquals(user.getZipCodeSuffix(), "test");
+ assertEquals(user.getJobTitle(), "test");
+ assertEquals(user.getCommandChain(), "test");
+ assertEquals(user.getSiloStatus(), "test");
+ assertEquals(user.getFinancialLocCode(), "test");
+ assertEquals(user.getLoginId(), "test");
+ assertEquals(user.getLoginPwd(), "test");
+ assertEquals(user.getActive(), false);
+ assertEquals(user.getInternal(), false);
+ assertEquals(user.getSelectedProfileId(), new Long (12345));
+ assertEquals(user.getTimeZoneId(), new Long (12345));
+ assertEquals(user.getChatId(), "test");
+
+ EPUser another = mockEPUser();
+ assertTrue(user.compareTo(another) == 0);
+ another.setLastName("otherlastname");
+ assertTrue(user.compareTo(another) == 5);
+
+ //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=[]]");
+ }
+
}