diff options
Diffstat (limited to 'controlloop/common/controller-usecases/src/test/java/org/onap')
-rw-r--r-- | controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/UsecasesEventManagerTest.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/UsecasesEventManagerTest.java b/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/UsecasesEventManagerTest.java index b87e56da6..d4979fb79 100644 --- a/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/UsecasesEventManagerTest.java +++ b/controlloop/common/controller-usecases/src/test/java/org/onap/policy/drools/apps/controller/usecases/UsecasesEventManagerTest.java @@ -188,10 +188,36 @@ public class UsecasesEventManagerTest { assertThatThrownBy(() -> new UsecasesEventManager(params, event, workMem)) .hasMessage("is-closed-loop-disabled is set to true on VServer or VNF"); + // vserver ACTIVE + event.setAai(addAai(orig, UsecasesConstants.VSERVER_PROV_STATUS, + UsecasesConstants.PROV_STATUS_ACTIVE.toUpperCase())); + assertThatCode(() -> new UsecasesEventManager(params, event, workMem)).doesNotThrowAnyException(); + + // vserver active + event.setAai(addAai(orig, UsecasesConstants.VSERVER_PROV_STATUS, + UsecasesConstants.PROV_STATUS_ACTIVE.toLowerCase())); + assertThatCode(() -> new UsecasesEventManager(params, event, workMem)).doesNotThrowAnyException(); + + // vserver inactive event.setAai(addAai(orig, UsecasesConstants.VSERVER_PROV_STATUS, "inactive")); assertThatThrownBy(() -> new UsecasesEventManager(params, event, workMem)) .hasMessage("prov-status is not ACTIVE on VServer or VNF"); + // vnf ACTIVE + event.setAai(addAai(orig, UsecasesConstants.GENERIC_VNF_PROV_STATUS, + UsecasesConstants.PROV_STATUS_ACTIVE.toUpperCase())); + assertThatCode(() -> new UsecasesEventManager(params, event, workMem)).doesNotThrowAnyException(); + + // vnf active + event.setAai(addAai(orig, UsecasesConstants.GENERIC_VNF_PROV_STATUS, + UsecasesConstants.PROV_STATUS_ACTIVE.toLowerCase())); + assertThatCode(() -> new UsecasesEventManager(params, event, workMem)).doesNotThrowAnyException(); + + // vnf inactive + event.setAai(addAai(orig, UsecasesConstants.GENERIC_VNF_PROV_STATUS, "inactive")); + assertThatThrownBy(() -> new UsecasesEventManager(params, event, workMem)) + .hasMessage("prov-status is not ACTIVE on VServer or VNF"); + // valid event.setAai(orig); assertThatCode(() -> mgr.checkEventSyntax(event)).doesNotThrowAnyException(); |