From 8d18569284ac43ef315b41c628872e0de0bbb57a Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Wed, 13 Feb 2019 11:44:35 -0500 Subject: fixed CandidateType json serialization fixed CandidateType json serialization Change-Id: Icafa5884db5424167c7fac08ad6aae5781bdafa5 Issue-ID: SO-1503 Signed-off-by: Benjamin, Max (mb388a) --- .../onap/so/bpmn/buildingblock/SniroHomingV2.java | 8 +--- .../org/onap/so/client/sniro/beans/Candidate.java | 2 + .../onap/so/client/sniro/beans/CandidateType.java | 43 ---------------------- .../SniroHoming/SniroManagerRequest1Vpn.json | 4 +- .../SniroHoming/SniroManagerRequest3Vpn.json | 12 ++---- 5 files changed, 8 insertions(+), 61 deletions(-) delete mode 100644 bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/CandidateType.java (limited to 'bpmn/so-bpmn-tasks/src') diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java index 92b4e211d5..cb893ce950 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java @@ -403,9 +403,7 @@ public class SniroHomingV2 { List cans = new ArrayList(); 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 cans = new ArrayList(); 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); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/Candidate.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/Candidate.java index 1f8c56e727..3b7e509752 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/Candidate.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/Candidate.java @@ -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 index d8984c0b83..0000000000 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/CandidateType.java +++ /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; - } - -} diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/SniroHoming/SniroManagerRequest1Vpn.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/SniroHoming/SniroManagerRequest1Vpn.json index 83ecd6add1..6713f80ad9 100644 --- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/SniroHoming/SniroManagerRequest1Vpn.json +++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/SniroHoming/SniroManagerRequest1Vpn.json @@ -42,9 +42,7 @@ "modelInvariantId" : "testProxyModelInvariantUuid2" }, "requiredCandidates" : [ { - "identifierType" : { - "name" : "vnfId" - }, + "identifierType" : "vnfId", "identifiers" : [ "testVnfId" ] } ] } ], diff --git a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/SniroHoming/SniroManagerRequest3Vpn.json b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/SniroHoming/SniroManagerRequest3Vpn.json index c3c5c0771a..14a89c90fc 100644 --- a/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/SniroHoming/SniroManagerRequest3Vpn.json +++ b/bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/SniroHoming/SniroManagerRequest3Vpn.json @@ -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" ] } ] } ], -- cgit 1.2.3-korg