diff options
author | Jim Hahn <jrh3@att.com> | 2020-03-03 21:02:13 -0500 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2020-03-05 15:42:01 -0500 |
commit | 03248c4de4197dac33c156e6a7a6538c9943305c (patch) | |
tree | 3224aa774d09649ed83d91a9a36f9bd969e701cf /models-interactions/model-simulators/src/test/java | |
parent | 7f1903bae3069d5e14b4c322c09c1317d90114b6 (diff) |
Add SO VF Module Delete Operation
Redesigned the SO Operation classes; moved some code from the subclass
to the superclass so it could be reused by the VF Module Delete Operation.
JerseyClient does not support DELETE with a request body, so had to
implement a delete() method using java11 HttpClient.
Fix some issues found while testing with drools-apps.
Added "delete" operation to SO simulator.
Issue-ID: POLICY-2371
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I269fe13cf90c295ec2bbac92bc5a59b3820ea265
Diffstat (limited to 'models-interactions/model-simulators/src/test/java')
-rw-r--r-- | models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java b/models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java index b287e3d81..723619e1c 100644 --- a/models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java +++ b/models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/SoSimulatorTest.java @@ -134,7 +134,7 @@ public class SoSimulatorTest { } @Test - public void testResponse() { + public void testPost() { final String request = Serialization.gsonPretty.toJson(this.createTestRequest()); final Pair<Integer, String> httpDetails = new RestManager().post( "http://localhost:6667/serviceInstantiation/v7/serviceInstances/12345/vnfs/12345/vfModules/scaleOut", @@ -144,4 +144,16 @@ public class SoSimulatorTest { final SoResponse response = Serialization.gsonPretty.fromJson(httpDetails.second, SoResponse.class); assertNotNull(response); } + + @Test + public void testDelete() { + final String request = Serialization.gsonPretty.toJson(this.createTestRequest()); + final Pair<Integer, String> httpDetails = new RestManager().delete( + "http://localhost:6667/serviceInstances/v7/12345/vnfs/12345/vfModules/12345", + "username", + "password", new HashMap<>(), "application/json", request); + assertNotNull(httpDetails); + final SoResponse response = Serialization.gsonPretty.fromJson(httpDetails.second, SoResponse.class); + assertNotNull(response); + } } |