From 0968bd68620bbd22e7ab855c9252be4178953a3a Mon Sep 17 00:00:00 2001 From: Dmitry Puzikov Date: Wed, 1 Apr 2020 17:11:21 +0200 Subject: Tests added to increase coverage Change-Id: I16a729385647cb691fb7c94bd8f26a3c19b1b99d Issue-ID: SDC-2861 Signed-off-by: Dmitry Puzikov --- .../sdc/be/tosca/model/CapabilityFilter.java | 28 ++++--------- .../openecomp/sdc/be/tosca/model/NodeFilter.java | 35 ++++------------ .../org/openecomp/sdc/be/user/UserMessage.java | 46 +++++----------------- 3 files changed, 23 insertions(+), 86 deletions(-) (limited to 'catalog-be/src/main/java') diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/CapabilityFilter.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/CapabilityFilter.java index 8afd9518ba..0197c3dabe 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/CapabilityFilter.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/CapabilityFilter.java @@ -16,40 +16,26 @@ package org.openecomp.sdc.be.tosca.model; - +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; import org.apache.commons.collections.CollectionUtils; import java.util.ArrayList; import java.util.List; import java.util.Map; - - +@Getter +@Setter +@ToString public class CapabilityFilter { - List>> properties; - - public List>> getProperties() { - return properties; - } - - public void setProperties(List>> properties) { - this.properties = properties; - } + private List>> properties; public void addProperty(Map> property) { if(CollectionUtils.isEmpty(properties)) { this.properties = new ArrayList<>(); } - this.properties.add(property); } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("CapabilityFilter{"); - sb.append("properties=").append(properties); - sb.append('}'); - return sb.toString(); - } } diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/NodeFilter.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/NodeFilter.java index 79e9f57209..f5511edd1b 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/NodeFilter.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/NodeFilter.java @@ -17,34 +17,13 @@ package org.openecomp.sdc.be.tosca.model; import java.util.List; import java.util.Map; +import lombok.Getter; +import lombok.Setter; +@Getter +@Setter public class NodeFilter { - - Object tosca_id; - List>> properties; - List> capabilities; - - public Object getTosca_id() { - return tosca_id; - } - - public void setTosca_id(Object tosca_id) { - this.tosca_id = tosca_id; - } - - public List> getCapabilities() { - return capabilities; - } - - public void setCapabilities(List> capabilities) { - this.capabilities = capabilities; - } - - public List>> getProperties() { - return properties; - } - - public void setProperties(List>> properties) { - this.properties = properties; - } + private Object tosca_id; + private List>> properties; + private List> capabilities; } \ No newline at end of file diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/user/UserMessage.java b/catalog-be/src/main/java/org/openecomp/sdc/be/user/UserMessage.java index 362bf34592..73943f6c4e 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/user/UserMessage.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/user/UserMessage.java @@ -20,51 +20,23 @@ package org.openecomp.sdc.be.user; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; import org.openecomp.sdc.be.catalog.api.ITypeMessage; -public class UserMessage implements ITypeMessage{ +@Getter +@Setter +@AllArgsConstructor +@ToString +public class UserMessage implements ITypeMessage { private UserOperationEnum operation; private String userId; private String role; - public UserMessage(UserOperationEnum operation, String userId, String role) { - this.setOperation(operation); - this.setUserId(userId); - this.setRole(role); - } - - public UserOperationEnum getOperation() { - return operation; - } - - public void setOperation(UserOperationEnum operation) { - this.operation = operation; - } - - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId; - } - - public String getRole() { - return role; - } - - public void setRole(String role) { - this.role = role; - } - - @Override - public String toString() { - return "UserMessage [operation=" + operation + ", userId=" + userId + ", role=" + role + "]"; - } - @Override public String getMessageType() { return getClass().getSimpleName(); } - } -- cgit 1.2.3-korg