From ffc78b2ad00d35e49e8ca3f8524483f6df171d50 Mon Sep 17 00:00:00 2001 From: "Straubs, Ralph (rs8887)" Date: Tue, 22 Oct 2019 10:43:09 -0500 Subject: Changes in preparation for the m2 model 1) Replace enum 'ControlLoopTargetType' with 'String' -- symbols such as 'ControlLoopTargetType.VM' still work, but now expand into a String. This gives the ability to add new application-specific types. 2) Move 'ControlLoopEvent.payload' to 'VirtualControlLoopEvent'. This symbol isn't common to all 'ControlLoopEvent' types, and this definition collides with a 'payload' defined in our application. 3) Add 'RestManager.patch(...)', which performs a REST patch. 4) Add lombok getters and setters 5) Remove trailing spaces 6) Fix order of arguments in 'assertEquals' in 'ControlLoopTargetTypeTest' 7) Update Junit tests in 'RestTest' to include 'RestManager.patch(...)' Issue-ID: POLICY-1948 Signed-off-by: Straubs, Ralph (rs8887) Change-Id: I08e04ea3cbcf368c760b630bcfe23a4370cf94dc --- .../java/org/onap/policy/controlloop/ControlLoopEventTest.java | 3 --- .../org/onap/policy/controlloop/ControlLoopTargetTypeTest.java | 10 ++++------ .../onap/policy/controlloop/VirtualControlLoopEventTest.java | 3 +++ 3 files changed, 7 insertions(+), 9 deletions(-) (limited to 'models-interactions/model-impl/events/src/test') diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopEventTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopEventTest.java index feaf22ee5..2def97572 100644 --- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopEventTest.java +++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopEventTest.java @@ -63,9 +63,6 @@ public class ControlLoopEventTest { event.setFrom("from"); assertEquals("from", event.getFrom()); - event.setPayload("payload"); - assertEquals("payload", event.getPayload()); - event.setPolicyName("policyname"); assertEquals("policyname", event.getPolicyName()); diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopTargetTypeTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopTargetTypeTest.java index d1412fe49..3434a591b 100644 --- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopTargetTypeTest.java +++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/ControlLoopTargetTypeTest.java @@ -30,11 +30,9 @@ public class ControlLoopTargetTypeTest { @Test public void test() { - assertEquals(ControlLoopTargetType.VM, ControlLoopTargetType.toType("VM")); - assertEquals(ControlLoopTargetType.VF, ControlLoopTargetType.toType("VF")); - assertEquals(ControlLoopTargetType.VFC, ControlLoopTargetType.toType("VFC")); - assertEquals(ControlLoopTargetType.VNF, ControlLoopTargetType.toType("VNF")); - - assertNull(ControlLoopTargetType.toType("foo")); + assertEquals("VM", ControlLoopTargetType.VM); + assertEquals("VF", ControlLoopTargetType.VF); + assertEquals("VFC", ControlLoopTargetType.VFC); + assertEquals("VNF", ControlLoopTargetType.VNF); } } diff --git a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/VirtualControlLoopEventTest.java b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/VirtualControlLoopEventTest.java index 2acd3038c..3fc7d133e 100644 --- a/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/VirtualControlLoopEventTest.java +++ b/models-interactions/model-impl/events/src/test/java/org/onap/policy/controlloop/VirtualControlLoopEventTest.java @@ -37,6 +37,9 @@ public class VirtualControlLoopEventTest { assertNotNull(event); assertNotNull(event.getAai()); + event.setPayload("payload"); + assertEquals("payload", event.getPayload()); + Instant now = Instant.now(); event.setClosedLoopAlarmStart(now); event.setClosedLoopAlarmEnd(now); -- cgit 1.2.3-korg