diff options
author | Straubs, Ralph (rs8887) <rs8887@att.com> | 2019-10-22 10:43:09 -0500 |
---|---|---|
committer | Straubs, Ralph (rs8887) <rs8887@att.com> | 2019-10-24 11:09:45 -0500 |
commit | ffc78b2ad00d35e49e8ca3f8524483f6df171d50 (patch) | |
tree | 44613578158b205e82e339e82f92d486d804501d /models-interactions/model-impl/events/src/test | |
parent | 5f69582dfaf325a8552ebeaa7cd69f81bc7d478f (diff) |
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) <rs8887@att.com>
Change-Id: I08e04ea3cbcf368c760b630bcfe23a4370cf94dc
Diffstat (limited to 'models-interactions/model-impl/events/src/test')
3 files changed, 7 insertions, 9 deletions
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); |