diff options
author | Parshad Patel <pars.patel@samsung.com> | 2019-08-20 11:09:03 +0900 |
---|---|---|
committer | Parshad Patel <pars.patel@samsung.com> | 2019-08-20 11:09:11 +0900 |
commit | eb34f877f352e8d9cd8f2e62693a2692e7f62dc3 (patch) | |
tree | 707968175372c4b1f75b4c106cb3aa9e7827f88f /ecomp-portal-BE-common/src/test | |
parent | 7ce177cd99096772ff42ef89d8820070c687fd9b (diff) |
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 <pars.patel@samsung.com>
Diffstat (limited to 'ecomp-portal-BE-common/src/test')
2 files changed, 41 insertions, 28 deletions
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<CentralV2UserApp> userApps = new HashSet<CentralV2UserApp>(); Set<CentralV2Role> pseudoRoles = new HashSet<CentralV2Role>(); - 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<CentralV2UserApp> userApps = new HashSet<CentralV2UserApp>(); Set<CentralV2Role> pseudoRoles = new HashSet<CentralV2Role>(); - 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<CentralV2UserApp> userApps = new HashSet<CentralV2UserApp>(); Set<CentralV2Role> pseudoRoles = new HashSet<CentralV2Role>(); - 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; } |