summaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java
diff options
context:
space:
mode:
authormichal.banka <michal.banka@nokia.com>2019-04-03 12:29:10 +0200
committermichal.banka <michal.banka@nokia.com>2019-04-04 10:22:43 +0200
commitd3076db84866ee94c3532699714b9e8c2e86593d (patch)
tree66076fcbe6d2d8d47c1401190c32d34fdcd0d992 /vid-app-common/src/main/java
parent13d5d23cf1e7fcd52244ef284019a0eb280bb14a (diff)
Increase test coverage for vid/aii - third part
Change-Id: Ib4da72c1da212cf009f70694ffcb0be4049cb67e Issue-ID: VID-385 Signed-off-by: michal.banka <michal.banka@nokia.com>
Diffstat (limited to 'vid-app-common/src/main/java')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/AaiGetVnfResponse.java8
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/SubscriberListWithFilterData.java7
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipList.java11
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/VnfResult.java19
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java2
5 files changed, 35 insertions, 12 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/AaiGetVnfResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/AaiGetVnfResponse.java
index 3938b164c..a62076073 100644
--- a/vid-app-common/src/main/java/org/onap/vid/aai/AaiGetVnfResponse.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/AaiGetVnfResponse.java
@@ -48,6 +48,14 @@ public class AaiGetVnfResponse {
this.additionalProperties.put(name, value);
}
+ public List<VnfResult> getResults() {
+ return results;
+ }
+
+ public void setResults(List<VnfResult> results) {
+ this.results = results;
+ }
+
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberListWithFilterData.java b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberListWithFilterData.java
index 6059eec74..d03362ba8 100644
--- a/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberListWithFilterData.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberListWithFilterData.java
@@ -34,7 +34,7 @@ public class SubscriberListWithFilterData {
public SubscriberListWithFilterData(SubscriberList subscriberList, RoleValidator roleValidator){
List<Subscriber> subscribers = subscriberList != null ? subscriberList.customer : new ArrayList<>();
- List<SubscriberWithFilter> subscribersWithFilter = new ArrayList<>();
+ customer = new ArrayList<>();
for (Subscriber subscriber :subscribers){
SubscriberWithFilter subscriberWithFilter = new SubscriberWithFilter();
subscriberWithFilter.setIsPermitted(roleValidator.isSubscriberPermitted(subscriber.globalCustomerId));
@@ -42,10 +42,9 @@ public class SubscriberListWithFilterData {
subscriberWithFilter.resourceVersion = subscriber.resourceVersion;
subscriberWithFilter.subscriberName = subscriber.subscriberName;
subscriberWithFilter.globalCustomerId = subscriber.globalCustomerId;
- subscribersWithFilter.add(subscriberWithFilter);
+ customer.add(subscriberWithFilter);
}
- this.customer = subscribersWithFilter;
- }
+ }
public List<SubscriberWithFilter> customer;
}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipList.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipList.java
index c30570d22..d6eb0526f 100644
--- a/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipList.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipList.java
@@ -27,20 +27,17 @@ import java.util.List;
@JsonIgnoreProperties(ignoreUnknown = true)
public class RelationshipList {
-
+
+ public List<Relationship> relationship;
+
@JsonProperty("relationship")
public List<Relationship> getRelationship() {
return relationship;
}
-
+
@JsonProperty("relationship")
public void setRelationship(List<Relationship> relationship) {
this.relationship = relationship;
}
- public List<Relationship> relationship;
-
-
-
-
}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/VnfResult.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/VnfResult.java
index 677602be1..6cbd8cdbf 100644
--- a/vid-app-common/src/main/java/org/onap/vid/aai/model/VnfResult.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/VnfResult.java
@@ -25,6 +25,7 @@ import com.fasterxml.jackson.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
@JsonInclude(JsonInclude.Include.NON_NULL)
@@ -83,4 +84,22 @@ public class VnfResult {
public void setJsonAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ VnfResult vnfResult = (VnfResult) o;
+ return Objects.equals(id, vnfResult.id) &&
+ Objects.equals(nodeType, vnfResult.nodeType) &&
+ Objects.equals(url, vnfResult.url) &&
+ Objects.equals(properties, vnfResult.properties) &&
+ Objects.equals(relatedTo, vnfResult.relatedTo) &&
+ Objects.equals(additionalProperties, vnfResult.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id, nodeType, url, properties, relatedTo, additionalProperties);
+ }
}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java b/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java
index 8f53fcdbf..92d8de757 100644
--- a/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java
@@ -133,7 +133,7 @@ public class AAIRestInterface {
*
* @param baseURL the base URL
*/
- public void SetRestSrvrBaseURL(String baseURL)
+ public void setRestSrvrBaseURL(String baseURL)
{
if (baseURL == null) {
logger.info(EELFLoggerDelegate.errorLogger, "REST Server base URL cannot be null.");