diff options
author | Arindam Mondal <arind.mondal@samsung.com> | 2019-04-18 19:05:58 +0900 |
---|---|---|
committer | arind.mondal <arind.mondal@samsung.com> | 2019-04-18 20:15:29 +0900 |
commit | b3ced8c4eb98a152076b3f0a05ba601bce7f8d2a (patch) | |
tree | b291f70c47c93cca6584665ee97161fb9452717d /ecomp-sdk/epsdk-core | |
parent | 383968fe6e903bc81c127e797b7c32cf99e0e246 (diff) |
Fix sonar issue: implement builder
Sonar link: https://sonar.onap.org/issues?projectUuids=AV8LJxI3uDqGnRl2bdaB&resolved=false&rules=squid%3AS00107
Issue-ID: PORTAL-559
Change-Id: I28c202e69f4856131b91918c41343ae6a5df3bbe
Signed-off-by: arind.mondal <arind.mondal@samsung.com>
Diffstat (limited to 'ecomp-sdk/epsdk-core')
2 files changed, 9 insertions, 4 deletions
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/ElementMapService.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/ElementMapService.java index 210e494d..7fdc5609 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/ElementMapService.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/ElementMapService.java @@ -655,10 +655,14 @@ public class ElementMapService { Domain eachDomain = domainMap.get(domainsKey); domainWidth += eachDomain.computeSize().getWidth(); } - thisDomain = new Domain(id, name, 2, 2, domainWidth, 10, 3, rows, columns); + thisDomain = new Domain.DomainBuilder().setId(id).setName(name).setInterContWd(2).setInterContH(2) + .setDomainToLayoutWd(domainWidth).setDomainToLayoutH(10).setDomainToContH(3) + .setNumOfRowsofContainer(rows).setNumOfColsofContainer(columns).createDomain(); } else { - thisDomain = new Domain(id, name, 2, 1, 11, 10, 3, rows, columns); + thisDomain = new Domain.DomainBuilder().setId(id).setName(name).setInterContWd(2).setInterContH(1) + .setDomainToLayoutWd(11).setDomainToLayoutH(10).setDomainToContH(3).setNumOfRowsofContainer(rows) + .setNumOfColsofContainer(columns).createDomain(); } thisDomain.setContainers(domainContainersMap); diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/ElementMapServiceTest.java b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/ElementMapServiceTest.java index f0e4304c..e2655b59 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/ElementMapServiceTest.java +++ b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/service/ElementMapServiceTest.java @@ -130,8 +130,9 @@ public class ElementMapServiceTest { Layout layout = new Layout(null, 0, 0, 2, 2); Map<String, Domain> domainRowCol = new HashMap<>(); - Domain domain = new Domain("test", "XYZ", 0, 0, 0, 0, 0, 2, 2); - + Domain domain = new Domain.DomainBuilder().setId("test").setName("XYZ").setInterContWd(0).setInterContH(0) + .setDomainToLayoutWd(0).setDomainToLayoutH(0).setDomainToContH(0).setNumOfRowsofContainer(2) + .setNumOfColsofContainer(2).createDomain(); Position position = new Position(); position.setX(10); position.setY(10); |