diff options
author | Pamela Dragosh <pdragosh@research.att.com> | 2017-09-12 19:29:46 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-12 19:29:46 +0000 |
commit | 19e8dcfa177d511fedb9d756f5de5de69509f76e (patch) | |
tree | f33fa3c1fb2706b8b19c5c37c66b3009896e9037 /controlloop | |
parent | e126a975d8c6f3970dbf87ead79fa69afe510301 (diff) | |
parent | d02b569900c1ea1870eba6647d5b223a89baeebb (diff) |
Merge "Fixing VFC Model response class"
Diffstat (limited to 'controlloop')
4 files changed, 10 insertions, 43 deletions
diff --git a/controlloop/common/model-impl/vfc/src/main/java/org/onap/policy/vfc/VFCResponseDescriptor.java b/controlloop/common/model-impl/vfc/src/main/java/org/onap/policy/vfc/VFCResponseDescriptor.java index f156fa0d0..9bf77c57c 100644 --- a/controlloop/common/model-impl/vfc/src/main/java/org/onap/policy/vfc/VFCResponseDescriptor.java +++ b/controlloop/common/model-impl/vfc/src/main/java/org/onap/policy/vfc/VFCResponseDescriptor.java @@ -19,7 +19,7 @@ package org.onap.policy.vfc; import java.io.Serializable; - +import java.util.List; import com.google.gson.annotations.SerializedName; public class VFCResponseDescriptor implements Serializable { @@ -42,7 +42,7 @@ public class VFCResponseDescriptor implements Serializable { String responseId; @SerializedName("responseHistoryList") - VFCResponseHistoryList responseHistoryList; + public List<VFCResponseDescriptor> responseHistoryList; public VFCResponseDescriptor() { } diff --git a/controlloop/common/model-impl/vfc/src/main/java/org/onap/policy/vfc/VFCResponseHistoryList.java b/controlloop/common/model-impl/vfc/src/main/java/org/onap/policy/vfc/VFCResponseHistoryList.java deleted file mode 100644 index 3fe62ea25..000000000 --- a/controlloop/common/model-impl/vfc/src/main/java/org/onap/policy/vfc/VFCResponseHistoryList.java +++ /dev/null @@ -1,36 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2017 Intel Corp. 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.policy.vfc; - -import java.io.Serializable; -import java.util.LinkedList; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - -public class VFCResponseHistoryList implements Serializable { - - private static final long serialVersionUID = 3340914325806649762L; - - public List<VFCResponseDescriptor> responseDescriptorList= new LinkedList<>(); - - public VFCResponseHistoryList() { - } - -} diff --git a/controlloop/common/model-impl/vfc/src/test/java/org/onap/policy/vfc/TestDemo.java b/controlloop/common/model-impl/vfc/src/test/java/org/onap/policy/vfc/TestDemo.java index 7e8c212e1..2bdb650ba 100644 --- a/controlloop/common/model-impl/vfc/src/test/java/org/onap/policy/vfc/TestDemo.java +++ b/controlloop/common/model-impl/vfc/src/test/java/org/onap/policy/vfc/TestDemo.java @@ -27,9 +27,10 @@ import org.onap.policy.vfc.VFCHealAdditionalParams; import org.onap.policy.vfc.VFCHealActionVmInfo; import org.onap.policy.vfc.VFCResponse; import org.onap.policy.vfc.VFCResponseDescriptor; -import org.onap.policy.vfc.VFCResponseHistoryList; import org.junit.Test; import org.onap.policy.vfc.util.Serialization; +import java.util.LinkedList; +import java.util.List; public class TestDemo { @@ -74,11 +75,15 @@ public class TestDemo { responseDescriptor.errorCode = null; responseDescriptor.responseId = "11"; - response.responseDescriptor.responseHistoryList = new VFCResponseHistoryList(); - response.responseDescriptor.responseHistoryList.responseDescriptorList.add(responseDescriptor); + response.responseDescriptor.responseHistoryList = new LinkedList(); + response.responseDescriptor.responseHistoryList.add(responseDescriptor); body = Serialization.gsonPretty.toJson(response); System.out.println(body); + response = Serialization.gsonPretty.fromJson(body, VFCResponse.class); + body = Serialization.gsonPretty.toJson(response); + System.out.println(body); + } } diff --git a/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/VfcSimulatorTest.java b/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/VfcSimulatorTest.java index 5bfc4a018..db110383c 100644 --- a/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/VfcSimulatorTest.java +++ b/controlloop/common/simulators/src/test/java/org/onap/policy/simulators/VfcSimulatorTest.java @@ -58,8 +58,6 @@ public class VfcSimulatorTest { assertNotNull(response); } - //This test case fails because the model code does not match the response I was given, I do not know which is wrong - @Ignore @Test public void testGet(){ Pair<Integer, String> httpDetails = RESTManager.get("http://localhost:6668/api/nslcm/v1/jobs/1234&responseId=5678", "username", "password", new HashMap<String, String>()); |