Merge "Allow multiple versions of entities to be returned"
authorJorge Hernandez <jorge.hernandez-herrero@att.com>
Mon, 17 Jun 2019 13:43:19 +0000 (13:43 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 17 Jun 2019 13:43:19 +0000 (13:43 +0000)
models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/GuardSimulatorJaxRs.java
models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/GuardSimulatorTest.java
models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyIdentifierOptVersion.java
models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyIdentifierOptVersionTest.java

index 25606ee..2712475 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * simulators
  * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -50,7 +50,7 @@ public class GuardSimulatorJaxRs {
     public DecisionResponse getGuardDecision(DecisionRequest req) {
         @SuppressWarnings("unchecked")
         Map<String, String> guard = (Map<String, String>) req.getResource().get("guard");
-        String clName = guard.get("clName");
+        String clName = guard.get("clname");
         DecisionResponse response = new DecisionResponse();
         if (DENY_CLNAME.equals(clName)) {
             response.setStatus("Deny");
index 58f748d..06c0d83 100644 (file)
@@ -86,7 +86,7 @@ public class GuardSimulatorTest {
         guard.put("actor", actor);
         guard.put("recipe", recipe);
         guard.put("target", target);
-        guard.put("clName", clName);
+        guard.put("clname", clName);
         Map<String, Object> resource = new HashMap<String, Object>();
         resource.put("guard", guard);
         DecisionRequest request = new DecisionRequest();
index a6aec08..ca3684a 100644 (file)
@@ -20,7 +20,6 @@
 
 package org.onap.policy.models.tosca.authorative.concepts;
 
-import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.google.gson.annotations.SerializedName;
 import lombok.Data;
 import lombok.NoArgsConstructor;
@@ -57,16 +56,6 @@ public class ToscaPolicyIdentifierOptVersion implements Comparable<ToscaPolicyId
         this.version = source.getVersion();
     }
 
-    /**
-     * Determines if the version is null/missing.
-     *
-     * @return {@code true} if the version is null/missing, {@code false}
-     */
-    @JsonIgnore
-    public boolean isNullVersion() {
-        return (version == null);
-    }
-
     @Override
     public int compareTo(ToscaPolicyIdentifierOptVersion other) {
         if (this == other) {
index 1d393c1..2ec2422 100644 (file)
@@ -22,8 +22,6 @@ package org.onap.policy.models.tosca.authorative.concepts;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
 
 import org.junit.Test;
 
@@ -45,12 +43,10 @@ public class ToscaPolicyIdentifierOptVersionTest extends ToscaIdentifierTestBase
         ToscaPolicyIdentifierOptVersion orig = new ToscaPolicyIdentifierOptVersion(NAME, null);
         assertEquals(NAME, orig.getName());
         assertEquals(null, orig.getVersion());
-        assertTrue(orig.isNullVersion());
 
         orig = new ToscaPolicyIdentifierOptVersion(NAME, VERSION);
         assertEquals(NAME, orig.getName());
         assertEquals(VERSION, orig.getVersion());
-        assertFalse(orig.isNullVersion());
     }
 
     @Test