diff options
author | Jim Hahn <jrh3@att.com> | 2020-11-10 11:39:51 -0500 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2020-11-10 22:42:42 +0000 |
commit | 9fca4743f8f305ce36b98db44f81b8d3143ac3e8 (patch) | |
tree | 4f77f2dc2394174e194c46cf5bc7eeb733b13a61 /controlloop/common/eventmanager/src/test | |
parent | ccc6a89ea93d7081aacbb596f6d2538b499f16c4 (diff) |
Allow mixed case in check of prov-status
Apparently SO/AAI in Frankfurt are setting the prov-status to "active"
instead of "ACTIVE". Modified the code to ignore case when comparing.
Issue-ID: POLICY-2890-prov-status2
Change-Id: I9e868d320dadcb3ac51570718d10f33d0011ae47
Signed-off-by: Jim Hahn <jrh3@att.com>
(cherry picked from commit 21362791e6488bb36f543f0319b195e24f239dcb)
Diffstat (limited to 'controlloop/common/eventmanager/src/test')
-rw-r--r-- | controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager2Test.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager2Test.java b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager2Test.java index da37e6fc3..d3c217c9f 100644 --- a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager2Test.java +++ b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManager2Test.java @@ -183,10 +183,36 @@ public class ControlLoopEventManager2Test { assertThatThrownBy(() -> new ControlLoopEventManager2Drools(params, event, workMem)) .hasMessage("is-closed-loop-disabled is set to true on VServer or VNF"); + // vserver ACTIVE + event.setAai(addAai(orig, ControlLoopEventManager2.VSERVER_PROV_STATUS, + ControlLoopEventManager2.PROV_STATUS_ACTIVE.toUpperCase())); + assertThatCode(() -> new ControlLoopEventManager2Drools(params, event, workMem)).doesNotThrowAnyException(); + + // vserver active + event.setAai(addAai(orig, ControlLoopEventManager2.VSERVER_PROV_STATUS, + ControlLoopEventManager2.PROV_STATUS_ACTIVE.toLowerCase())); + assertThatCode(() -> new ControlLoopEventManager2Drools(params, event, workMem)).doesNotThrowAnyException(); + + // vserver inactive event.setAai(addAai(orig, ControlLoopEventManager2.VSERVER_PROV_STATUS, "inactive")); assertThatThrownBy(() -> new ControlLoopEventManager2Drools(params, event, workMem)) .hasMessage("prov-status is not ACTIVE on VServer or VNF"); + // vnf ACTIVE + event.setAai(addAai(orig, ControlLoopEventManager2.GENERIC_VNF_PROV_STATUS, + ControlLoopEventManager2.PROV_STATUS_ACTIVE.toUpperCase())); + assertThatCode(() -> new ControlLoopEventManager2Drools(params, event, workMem)).doesNotThrowAnyException(); + + // vnf active + event.setAai(addAai(orig, ControlLoopEventManager2.GENERIC_VNF_PROV_STATUS, + ControlLoopEventManager2.PROV_STATUS_ACTIVE.toLowerCase())); + assertThatCode(() -> new ControlLoopEventManager2Drools(params, event, workMem)).doesNotThrowAnyException(); + + // vnf inactive + event.setAai(addAai(orig, ControlLoopEventManager2.GENERIC_VNF_PROV_STATUS, "inactive")); + assertThatThrownBy(() -> new ControlLoopEventManager2Drools(params, event, workMem)) + .hasMessage("prov-status is not ACTIVE on VServer or VNF"); + // valid event.setAai(orig); assertThatCode(() -> mgr.checkEventSyntax(event)).doesNotThrowAnyException(); |