From eb34f877f352e8d9cd8f2e62693a2692e7f62dc3 Mon Sep 17 00:00:00 2001 From: Parshad Patel Date: Tue, 20 Aug 2019 11:09:03 +0900 Subject: Reduce number of parameters in constructor Constructor has 53 parameters, which is greater than 7 authorized Issue-ID: PORTAL-562 Change-Id: Ia318321b06d17cd9c2c2e8af7274b7a7550abd7a Signed-off-by: Parshad Patel --- .../portal/transport/CentralUserTest.java | 46 +++++++++++++--------- .../portal/transport/CentralV2UserTest.java | 23 ++++++----- 2 files changed, 41 insertions(+), 28 deletions(-) (limited to 'ecomp-portal-BE-common/src/test/java') 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 28292ba6..5291c0dd 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 @@ -62,15 +62,20 @@ public class CentralUserTest { public CentralV2User mockCentralUser(){ Set userApps = new HashSet(); Set pseudoRoles = new HashSet(); - CentralV2User centralV2User = new CentralV2User((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); + CentralV2User centralV2User = new CentralV2User.CentralV2UserBuilder().setId((long) 1).setCreated(null) + .setModified(null).setCreatedId((long) 1).setModifiedId((long) 1).setRowNum((long) 1).setOrgId((long) 1) + .setManagerId((long) 1).setFirstName("test").setMiddleInitial("test").setLastName("test") + .setPhone("test").setFax("test").setCellular("test").setEmail("test").setAddressId((long) 1) + .setAlertMethodCd("test").setHrid("test").setOrgUserId("test").setOrgCode("test").setAddress1("test") + .setAddress2("test").setCity("test").setState("test").setZipCode("test").setCountry("test") + .setOrgManagerUserId("test").setLocationClli("test").setBusinessCountryCode("test") + .setBusinessCountryName("test").setBusinessUnit("test").setBusinessUnitName("test") + .setDepartment("test").setDepartmentName("test").setCompanyCode("test").setCompany("test") + .setZipCodeSuffix("test").setJobTitle("test").setCommandChain("test").setSiloStatus("test") + .setCostCenter("test").setFinancialLocCode("test").setLoginId("test").setLoginPwd("test") + .setLastLoginDate(null).setActive(false).setInternal(false).setSelectedProfileId((long) 1) + .setTimeZoneId((long) 1).setOnline(false).setChatId("test").setUserApps(userApps) + .setPseudoRoles(pseudoRoles).createCentralV2User(); return centralV2User; } @@ -81,15 +86,20 @@ public class CentralUserTest { Set userApps = new HashSet(); Set pseudoRoles = new HashSet(); - CentralV2User centralV2User1 = new CentralV2User((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); + CentralV2User centralV2User1 = new CentralV2User.CentralV2UserBuilder().setId((long) 1).setCreated(null) + .setModified(null).setCreatedId((long) 1).setModifiedId((long) 1).setRowNum((long) 1).setOrgId((long) 1) + .setManagerId((long) 1).setFirstName("test").setMiddleInitial("test").setLastName("test") + .setPhone("test").setFax("test").setCellular("test").setEmail("test").setAddressId((long) 1) + .setAlertMethodCd("test").setHrid("test").setOrgUserId("test").setOrgCode("test").setAddress1("test") + .setAddress2("test").setCity("test").setState("test").setZipCode("test").setCountry("test") + .setOrgManagerUserId("test").setLocationClli("test").setBusinessCountryCode("test") + .setBusinessCountryName("test").setBusinessUnit("test").setBusinessUnitName("test") + .setDepartment("test").setDepartmentName("test").setCompanyCode("test").setCompany("test") + .setZipCodeSuffix("test").setJobTitle("test").setCommandChain("test").setSiloStatus("test") + .setCostCenter("test").setFinancialLocCode("test").setLoginId("test").setLoginPwd("test") + .setLastLoginDate(null).setActive(false).setInternal(false).setSelectedProfileId((long) 1) + .setTimeZoneId((long) 1).setOnline(false).setChatId("test").setUserApps(userApps) + .setPseudoRoles(pseudoRoles).createCentralV2User(); assertEquals(centralV2User, centralV2User1); diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralV2UserTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralV2UserTest.java index 0f7da0a1..81650bdd 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralV2UserTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralV2UserTest.java @@ -61,7 +61,7 @@ public class CentralV2UserTest { CentralV2User user=buildV2User(); user.setZipCodeSuffix(TEST); - CentralV2User centrlUser=new CentralV2User(); + CentralV2User centrlUser = new CentralV2User.CentralV2UserBuilder().createCentralV2User(); centrlUser.setId(user.getId()); centrlUser.setCreated(user.getCreated()); centrlUser.setModified(user.getModified()); @@ -249,15 +249,18 @@ public class CentralV2UserTest { public CentralV2User buildV2User(){ Set userApps = new HashSet(); Set pseudoRoles = new HashSet(); - CentralV2User centralV2User = new CentralV2User(ID, DATE, DATE, ID, ID, ID, ID, - ID, TEST, TEST, TEST, TEST, TEST, - TEST, TEST, ID, 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, ID, ID, false, TEST, userApps, pseudoRoles); + CentralV2User centralV2User = new CentralV2User.CentralV2UserBuilder().setId(ID).setCreated(DATE) + .setModified(DATE).setCreatedId(ID).setModifiedId(ID).setRowNum(ID).setOrgId(ID).setManagerId(ID) + .setFirstName(TEST).setMiddleInitial(TEST).setLastName(TEST).setPhone(TEST).setFax(TEST) + .setCellular(TEST).setEmail(TEST).setAddressId(ID).setAlertMethodCd(TEST).setHrid(TEST) + .setOrgUserId(TEST).setOrgCode(TEST).setAddress1(TEST).setAddress2(TEST).setCity(TEST).setState(TEST) + .setZipCode(TEST).setCountry(TEST).setOrgManagerUserId(TEST).setLocationClli(TEST) + .setBusinessCountryCode(TEST).setBusinessCountryName(TEST).setBusinessUnit(TEST) + .setBusinessUnitName(TEST).setDepartment(TEST).setDepartmentName(TEST).setCompanyCode(TEST) + .setCompany(TEST).setZipCodeSuffix(TEST).setJobTitle(TEST).setCommandChain(TEST).setSiloStatus(TEST) + .setCostCenter(TEST).setFinancialLocCode(TEST).setLoginId(TEST).setLoginPwd(TEST).setLastLoginDate(null) + .setActive(false).setInternal(false).setSelectedProfileId(ID).setTimeZoneId(ID).setOnline(false) + .setChatId(TEST).setUserApps(userApps).setPseudoRoles(pseudoRoles).createCentralV2User(); return centralV2User; } -- cgit 1.2.3-korg