fixed CandidateType json serialization 12/78412/1
authorBenjamin, Max (mb388a) <mb388a@us.att.com>
Wed, 13 Feb 2019 16:44:35 +0000 (11:44 -0500)
committerBenjamin, Max (mb388a) <mb388a@us.att.com>
Wed, 13 Feb 2019 16:44:35 +0000 (11:44 -0500)
fixed CandidateType json serialization

Change-Id: Icafa5884db5424167c7fac08ad6aae5781bdafa5
Issue-ID: SO-1503
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/homingobjects/CandidateType.java
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/Candidate.java
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/CandidateType.java [deleted file]
bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/SniroHoming/SniroManagerRequest1Vpn.json
bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/SniroHoming/SniroManagerRequest3Vpn.json

index f1534ab..6a4fa50 100644 (file)
@@ -20,6 +20,8 @@
 
 package org.onap.so.bpmn.servicedecomposition.homingobjects;
 
+import com.fasterxml.jackson.annotation.JsonValue;
+
 public enum CandidateType{
 
 
@@ -35,11 +37,8 @@ public enum CandidateType{
        }
 
        @Override
+       @JsonValue
        public String toString() {
                return name;
        }
-
-       public String getName(){
-               return name;
-       }
 }
index 92b4e21..cb893ce 100644 (file)
@@ -403,9 +403,7 @@ public class SniroHomingV2 {
                        List<org.onap.so.client.sniro.beans.Candidate> cans = new ArrayList<org.onap.so.client.sniro.beans.Candidate>();
                        for(Candidate c:required){
                                org.onap.so.client.sniro.beans.Candidate can = new org.onap.so.client.sniro.beans.Candidate();
-                               org.onap.so.client.sniro.beans.CandidateType type = new org.onap.so.client.sniro.beans.CandidateType();
-                               type.setName(c.getIdentifierType().getName());
-                               can.setIdentifierType(type);
+                               can.setIdentifierType(c.getIdentifierType());
                                can.setIdentifiers(c.getIdentifiers());
                                can.setCloudOwner(c.getCloudOwner());
                                cans.add(can);
@@ -416,9 +414,7 @@ public class SniroHomingV2 {
                        List<org.onap.so.client.sniro.beans.Candidate> cans = new ArrayList<org.onap.so.client.sniro.beans.Candidate>();
                        for(Candidate c:excluded){
                                org.onap.so.client.sniro.beans.Candidate can = new org.onap.so.client.sniro.beans.Candidate();
-                               org.onap.so.client.sniro.beans.CandidateType type = new org.onap.so.client.sniro.beans.CandidateType();
-                               type.setName(c.getIdentifierType().getName());
-                               can.setIdentifierType(type);
+                               can.setIdentifierType(c.getIdentifierType());
                                can.setIdentifiers(c.getIdentifiers());
                                can.setCloudOwner(c.getCloudOwner());
                                cans.add(can);
index 1f8c56e..3b7e509 100644 (file)
@@ -23,6 +23,8 @@ package org.onap.so.client.sniro.beans;
 import java.io.Serializable;
 import java.util.List;
 
+import org.onap.so.bpmn.servicedecomposition.homingobjects.CandidateType;
+
 import com.fasterxml.jackson.annotation.JsonProperty;
 
 public class Candidate implements Serializable{
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/CandidateType.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/CandidateType.java
deleted file mode 100644 (file)
index d8984c0..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.client.sniro.beans;
-
-import java.io.Serializable;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class CandidateType implements Serializable{
-
-       private static final long serialVersionUID = 2273215496314532173L;
-
-       @JsonProperty("name")
-       private String name;
-
-
-       public String getName(){
-               return name;
-       }
-
-       public void setName(String name){
-               this.name = name;
-       }
-
-}
index 83ecd6a..6713f80 100644 (file)
@@ -42,9 +42,7 @@
         "modelInvariantId" : "testProxyModelInvariantUuid2"
       },
       "requiredCandidates" : [ {
-        "identifierType" : {
-          "name" : "vnfId"
-        },
+        "identifierType" : "vnfId",
         "identifiers" : [ "testVnfId" ]
       } ]
     } ],
index c3c5c07..14a89c9 100644 (file)
@@ -42,9 +42,7 @@
         "modelInvariantId" : "testProxyModelInvariantUuid2"
       },
       "requiredCandidates" : [ {
-        "identifierType" : {
-          "name" : "vnfId"
-        },
+        "identifierType" : "vnfId",
         "identifiers" : [ "testVnfId" ]
       } ]
     }, {
@@ -66,9 +64,7 @@
         "modelInvariantId" : "testProxyModelInvariantUuid2"
       },
       "requiredCandidates" : [ {
-        "identifierType" : {
-          "name" : "vnfId"
-        },
+        "identifierType" : "vnfId",
         "identifiers" : [ "testVnfId" ]
       } ]
     }, {
@@ -90,9 +86,7 @@
         "modelInvariantId" : "testProxyModelInvariantUuid2"
       },
       "requiredCandidates" : [ {
-        "identifierType" : {
-          "name" : "vnfId"
-        },
+        "identifierType" : "vnfId",
         "identifiers" : [ "testVnfId" ]
       } ]
     } ],