summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-BE-common/src/test
diff options
context:
space:
mode:
authorArindam Mondal <arind.mondal@samsung.com>2019-04-19 13:57:34 +0900
committerarind.mondal <arind.mondal@samsung.com>2019-04-19 13:57:56 +0900
commit8dc7c79b05b1059392974055628dec0463616002 (patch)
tree97ead376fce5c3b6164e3b113c04f71e6705c6c0 /ecomp-portal-BE-common/src/test
parentc97fca88eab7acc8a6b4bbfc469d7478f03f3112 (diff)
Sonar fix too mnay method param
+) Reduced too many method param ++) Code format Issue-ID: PORTAL-561 Change-Id: I2c27344477b318ab0f1a77442579be459c3597fd Signed-off-by: Arindam Mondal <arind.mondal@samsung.com>
Diffstat (limited to 'ecomp-portal-BE-common/src/test')
-rw-r--r--ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralRoleTest.java21
-rw-r--r--ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralUserAppTest.java63
2 files changed, 42 insertions, 42 deletions
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralRoleTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralRoleTest.java
index 5ba983c4..41cba036 100644
--- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralRoleTest.java
+++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralRoleTest.java
@@ -47,7 +47,7 @@ import org.junit.Test;
public class CentralRoleTest {
- CentralRole centralRole=new CentralRole();
+ CentralRole centralRole= new CentralRole.CentralRoleBuilder().createCentralRole();
/*public CentralV2Role mockCentralRole(){
@@ -99,16 +99,19 @@ public class CentralRoleTest {
}*/
@Test
- public void unt_centralRoleConstructorTest(){
- centralRole=new CentralRole(null, null, null, null, null, null, null, false, null, null, null, null);
- assertEquals(false, centralRole.isActive());
- }
+ public void unt_centralRoleConstructorTest() {
+ centralRole = new CentralRole.CentralRoleBuilder().setId(null).setCreated(null).setModified(null)
+ .setCreatedId(null).setModifiedId(null).setRowNum(null).setName(null).setActive(false).setPriority(null)
+ .setRoleFunctions(null).setChildRoles(null).setParentRoles(null).createCentralRole();
+ assertEquals(false, centralRole.isActive());
+ }
@Test
- public void unt_centralRoleConstructor2Test(){
- centralRole=new CentralRole(null, null, false, null, null);
- assertEquals(false, centralRole.isActive());
- }
+ public void unt_centralRoleConstructor2Test() {
+ centralRole = new CentralRole.CentralRoleBuilder().setId(null).setName(null).setActive(false).setPriority(null)
+ .setRoleFunctions(null).createCentralRole();
+ assertEquals(false, centralRole.isActive());
+ }
@Test
public void unt_IdTest(){
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralUserAppTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralUserAppTest.java
index f516e839..6340eb92 100644
--- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralUserAppTest.java
+++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralUserAppTest.java
@@ -42,9 +42,6 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
-import org.onap.portalapp.portal.transport.CentralApp;
-import org.onap.portalapp.portal.transport.CentralV2Role;
-import org.onap.portalapp.portal.transport.CentralV2UserApp;
public class CentralUserAppTest {
@@ -57,7 +54,7 @@ public class CentralUserAppTest {
app.setPriority((Integer)1);
CentralApp centralApp=new CentralApp();
centralApp.setName(TEST);
- CentralRole role=new CentralRole();
+ CentralRole role= new CentralRole.CentralRoleBuilder().createCentralRole();
role.setName(TEST);
app.setApp(centralApp);
app.setRole(role);
@@ -87,39 +84,39 @@ public class CentralUserAppTest {
}
- public CentralV2UserApp mockCentralUserApp(){
- CentralV2UserApp centralV2UserApp = new CentralV2UserApp();
-
- CentralApp app = new CentralApp((long)1, null, null,ID,ID,ID, TEST, TEST, TEST, TEST, TEST, TEST, TEST, TEST, TEST,
- TEST, TEST, TEST, TEST, null, TEST, TEST, TEST, TEST);
-
- CentralV2Role role = new CentralV2Role();
-
- centralV2UserApp.setUserId((long)1);
- centralV2UserApp.setApp(app);
- centralV2UserApp.setRole(role);
- centralV2UserApp.setPriority((Integer) 123);
-
- return centralV2UserApp;
- }
+ public CentralV2UserApp mockCentralUserApp() {
+ CentralV2UserApp centralV2UserApp = new CentralV2UserApp();
+
+ CentralApp app = new CentralApp((long) 1, null, null, ID, ID, ID, TEST, TEST, TEST, TEST, TEST, TEST, TEST,
+ TEST, TEST, TEST, TEST, TEST, TEST, null, TEST, TEST, TEST, TEST);
+
+ CentralV2Role role = new CentralV2Role();
+
+ centralV2UserApp.setUserId((long) 1);
+ centralV2UserApp.setApp(app);
+ centralV2UserApp.setRole(role);
+ centralV2UserApp.setPriority((Integer) 123);
+
+ return centralV2UserApp;
+ }
@Test
- public void centralUserAppTest(){
- CentralV2UserApp centralV2UserApp = mockCentralUserApp();
-
- CentralApp app1 = new CentralApp((long)1, null, null,ID,ID,ID, TEST, TEST, TEST, TEST, TEST, TEST, TEST, TEST, TEST,
- TEST, TEST, TEST, TEST, null, TEST, TEST, TEST, TEST);
-
-
- CentralV2Role role1 = new CentralV2Role();
-
- assertEquals(centralV2UserApp.getUserId(), new Long(1));
- assertEquals(centralV2UserApp.getPriority(), new Integer((Integer) 123));
- assertEquals(centralV2UserApp.getApp(), app1);
- assertEquals(centralV2UserApp.getRole(), role1);
- }
+ public void centralUserAppTest() {
+ CentralV2UserApp centralV2UserApp = mockCentralUserApp();
+
+ CentralApp app1 = new CentralApp((long) 1, null, null, ID, ID, ID, TEST, TEST, TEST, TEST, TEST, TEST, TEST,
+ TEST, TEST, TEST, TEST, TEST, TEST, null, TEST, TEST, TEST, TEST);
+
+
+ CentralV2Role role1 = new CentralV2Role();
+
+ assertEquals(centralV2UserApp.getUserId(), new Long(1));
+ assertEquals(centralV2UserApp.getPriority(), new Integer((Integer) 123));
+ assertEquals(centralV2UserApp.getApp(), app1);
+ assertEquals(centralV2UserApp.getRole(), role1);
+ }
@Test
public void unt_hashCodeTest(){