diff options
author | Manoop Talasila <talasila@research.att.com> | 2019-08-19 14:49:22 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-08-19 14:49:22 +0000 |
commit | 7ce177cd99096772ff42ef89d8820070c687fd9b (patch) | |
tree | 277991e9d0784049936e7742587af6f67963a24c /ecomp-portal-BE-common/src/test | |
parent | f71707238ebabd9911277af55673b1d42ac1495f (diff) | |
parent | 31e135a9ffb7e20fa146f841c5e3a2782f8131a5 (diff) |
Merge "Reduce number of parameters in constructor"
Diffstat (limited to 'ecomp-portal-BE-common/src/test')
2 files changed, 26 insertions, 14 deletions
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/ExternalAccessRolesControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/ExternalAccessRolesControllerTest.java index 3373ef92..3d30f9f5 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/ExternalAccessRolesControllerTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/ExternalAccessRolesControllerTest.java @@ -68,11 +68,7 @@ import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum; import org.onap.portalapp.portal.framework.MockitoTestSuite; import org.onap.portalapp.portal.service.ExternalAccessRolesService; import org.onap.portalapp.portal.service.ExternalAccessRolesServiceImpl; -import org.onap.portalapp.portal.transport.CentralRole; -import org.onap.portalapp.portal.transport.CentralRoleFunction; -import org.onap.portalapp.portal.transport.CentralUser; -import org.onap.portalapp.portal.transport.CentralV2Role; -import org.onap.portalapp.portal.transport.ExternalRequestFieldsValidator; +import org.onap.portalapp.portal.transport.*; import org.onap.portalapp.portal.utils.EPCommonSystemProperties; import org.onap.portalapp.portal.utils.EcompPortalUtils; import org.onap.portalapp.portal.utils.PortalConstants; @@ -151,11 +147,20 @@ public class ExternalAccessRolesControllerTest { @Test public void getUserTest() throws Exception { - CentralUser expectedCentralUser = new CentralUser(null, null, null, null, null, null, null, null, loginId, - loginId, loginId, loginId, loginId, loginId, loginId, null, loginId, loginId, loginId, loginId, loginId, - loginId, loginId, loginId, loginId, loginId, loginId, loginId, loginId, loginId, loginId, loginId, - loginId, loginId, loginId, loginId, loginId, loginId, loginId, loginId, loginId, loginId, loginId, - loginId, null, false, false, null, null, false, loginId, null); + CentralUser expectedCentralUser = + new CentralUser.CentralUserBuilder().setId(null).setCreated(null).setModified(null).setCreatedId(null) + .setModifiedId(null).setRowNum(null).setOrgId(null).setManagerId(null).setFirstName(loginId) + .setMiddleInitial(loginId).setLastName(loginId).setPhone(loginId).setFax(loginId) + .setCellular(loginId).setEmail(loginId).setAddressId(null).setAlertMethodCd(loginId) + .setHrid(loginId).setOrgUserId(loginId).setOrgCode(loginId).setAddress1(loginId) + .setAddress2(loginId).setCity(loginId).setState(loginId).setZipCode(loginId).setCountry(loginId) + .setOrgManagerUserId(loginId).setLocationClli(loginId).setBusinessCountryCode(loginId) + .setBusinessCountryName(loginId).setBusinessUnit(loginId).setBusinessUnitName(loginId) + .setDepartment(loginId).setDepartmentName(loginId).setCompanyCode(loginId).setCompany(loginId) + .setZipCodeSuffix(loginId).setJobTitle(loginId).setCommandChain(loginId).setSiloStatus(loginId) + .setCostCenter(loginId).setFinancialLocCode(loginId).setLoginId(loginId).setLoginPwd(loginId) + .setLastLoginDate(null).setActive(false).setInternal(false).setSelectedProfileId(null) + .setTimeZoneId(null).setOnline(false).setChatId(loginId).setUserApps(null).createCentralUser(); String loginId = "test"; StringWriter sw = new StringWriter(); PrintWriter writer = new PrintWriter(sw); diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralUserTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralUserTest.java index b8c019b0..28292ba6 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralUserTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralUserTest.java @@ -44,13 +44,20 @@ import java.util.HashSet; import java.util.Set; import org.junit.Test; -import org.onap.portalapp.portal.transport.CentralV2Role; -import org.onap.portalapp.portal.transport.CentralV2User; -import org.onap.portalapp.portal.transport.CentralV2UserApp; public class CentralUserTest { - CentralUser centralUser=new CentralUser(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, false, false, null, null, false, null, null); + CentralUser centralUser = new CentralUser.CentralUserBuilder().setId(null).setCreated(null).setModified(null) + .setCreatedId(null).setModifiedId(null).setRowNum(null).setOrgId(null).setManagerId(null).setFirstName(null) + .setMiddleInitial(null).setLastName(null).setPhone(null).setFax(null).setCellular(null).setEmail(null) + .setAddressId(null).setAlertMethodCd(null).setHrid(null).setOrgUserId(null).setOrgCode(null) + .setAddress1(null).setAddress2(null).setCity(null).setState(null).setZipCode(null).setCountry(null) + .setOrgManagerUserId(null).setLocationClli(null).setBusinessCountryCode(null).setBusinessCountryName(null) + .setBusinessUnit(null).setBusinessUnitName(null).setDepartment(null).setDepartmentName(null) + .setCompanyCode(null).setCompany(null).setZipCodeSuffix(null).setJobTitle(null).setCommandChain(null) + .setSiloStatus(null).setCostCenter(null).setFinancialLocCode(null).setLoginId(null).setLoginPwd(null) + .setLastLoginDate(null).setActive(false).setInternal(false).setSelectedProfileId(null).setTimeZoneId(null) + .setOnline(false).setChatId(null).setUserApps(null).createCentralUser(); public CentralV2User mockCentralUser(){ Set<CentralV2UserApp> userApps = new HashSet<CentralV2UserApp>(); |