aboutsummaryrefslogtreecommitdiffstats
path: root/examples/examples-grpc/src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/examples-grpc/src')
-rw-r--r--examples/examples-grpc/src/main/resources/examples/events/APEXgRPC/CDSResponseStatusEvent.json3
-rw-r--r--examples/examples-grpc/src/main/resources/examples/events/APEXgRPC/LogEvent.json3
-rw-r--r--examples/examples-grpc/src/main/resources/policy/APEXgRPCPolicy.apex7
-rw-r--r--examples/examples-grpc/src/test/java/org/onap/policy/apex/examples/grpc/TestApexGrpcExample.java7
4 files changed, 12 insertions, 8 deletions
diff --git a/examples/examples-grpc/src/main/resources/examples/events/APEXgRPC/CDSResponseStatusEvent.json b/examples/examples-grpc/src/main/resources/examples/events/APEXgRPC/CDSResponseStatusEvent.json
index 938983362..d616ac12e 100644
--- a/examples/examples-grpc/src/main/resources/examples/events/APEXgRPC/CDSResponseStatusEvent.json
+++ b/examples/examples-grpc/src/main/resources/examples/events/APEXgRPC/CDSResponseStatusEvent.json
@@ -4,10 +4,11 @@
"nameSpace": "org.onap.policy.apex.onap.pmcontrol",
"source": "APEX",
"target": "DCAE",
+ "toscaPolicyState": "EXIT_SUCCESS",
"status": {
"subscriptionName": "testPolicyB",
"nfName": "pnf300",
"changeType": "CREATE",
"message": "success"
}
-}
+} \ No newline at end of file
diff --git a/examples/examples-grpc/src/main/resources/examples/events/APEXgRPC/LogEvent.json b/examples/examples-grpc/src/main/resources/examples/events/APEXgRPC/LogEvent.json
index e227b6699..6fd90771f 100644
--- a/examples/examples-grpc/src/main/resources/examples/events/APEXgRPC/LogEvent.json
+++ b/examples/examples-grpc/src/main/resources/examples/events/APEXgRPC/LogEvent.json
@@ -4,6 +4,7 @@
"nameSpace": "org.onap.policy.apex.onap.pmcontrol",
"source": "APEX",
"target": "DCAE",
+ "toscaPolicyState": "",
"final_status": "FINAL_SUCCESS",
"message": "Operation successfully completed."
-}
+} \ No newline at end of file
diff --git a/examples/examples-grpc/src/main/resources/policy/APEXgRPCPolicy.apex b/examples/examples-grpc/src/main/resources/policy/APEXgRPCPolicy.apex
index 636c74b80..34d590dcf 100644
--- a/examples/examples-grpc/src/main/resources/policy/APEXgRPCPolicy.apex
+++ b/examples/examples-grpc/src/main/resources/policy/APEXgRPCPolicy.apex
@@ -1,7 +1,7 @@
#-------------------------------------------------------------------------------
# ============LICENSE_START=======================================================
# Copyright (C) 2020 Nordix Foundation.
-# Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
+# Modifications Copyright (C) 2021-2022 Bell Canada. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -75,7 +75,8 @@ LE
album create name=PMSubscriptionAlbum scope=policy writable=true schemaName=PMSubscriptionType
-event create name=testPolicyB version=0.0.1 nameSpace=org.onap.policy.apex.onap.pmcontrol source=DCAE target=APEX
+# Incoming event
+event create name=testPolicyB version=0.0.1 nameSpace=org.onap.policy.apex.onap.pmcontrol source=DCAE target=APEX toscaPolicyState=ENTRY
event parameter create name=testPolicyB parName=nfName schemaName=SimpleStringType
event parameter create name=testPolicyB parName=policyName schemaName=SimpleStringType
event parameter create name=testPolicyB parName=changeType schemaName=SimpleStringType
@@ -109,7 +110,7 @@ event parameter create name=CDSResponseEvent parName=actionIdentifiers schemaNam
event parameter create name=CDSResponseEvent parName=status schemaName=CDSResponseStatusType
event parameter create name=CDSResponseEvent parName=payload schemaName=CDSResponsePayloadType
-event create name=CDSResponseStatusEvent nameSpace=org.onap.policy.apex.onap.pmcontrol source=APEX target=DCAE
+event create name=CDSResponseStatusEvent nameSpace=org.onap.policy.apex.onap.pmcontrol source=APEX target=DCAE toscaPolicyState=EXIT_SUCCESS
event parameter create name=CDSResponseStatusEvent parName=status schemaName=SubscriptionStatusType
event create name=LogEvent nameSpace=org.onap.policy.apex.onap.pmcontrol source=APEX target=DCAE
diff --git a/examples/examples-grpc/src/test/java/org/onap/policy/apex/examples/grpc/TestApexGrpcExample.java b/examples/examples-grpc/src/test/java/org/onap/policy/apex/examples/grpc/TestApexGrpcExample.java
index a197432ba..f5a51a7fe 100644
--- a/examples/examples-grpc/src/test/java/org/onap/policy/apex/examples/grpc/TestApexGrpcExample.java
+++ b/examples/examples-grpc/src/test/java/org/onap/policy/apex/examples/grpc/TestApexGrpcExample.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2020 Nordix Foundation.
- * Modifications Copyright (C) 2020-2021 Bell Canada. All rights reserved.
+ * Modifications Copyright (C) 2020-2022 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -91,6 +91,7 @@ public class TestApexGrpcExample {
Files.readString(Paths.get("src/main/resources/examples/events/APEXgRPC/CDSResponseStatusEvent.json"))
.replaceAll("\r", "");
// Both LogEvent and CDSResponseStatusEvent are generated from the final state in the policy
- assertThat(responseEntity).contains(expectedStatusEvent + expectedLoggedOutputEvent);
+ assertThat(responseEntity).contains(expectedStatusEvent);
+ assertThat(responseEntity).contains(expectedLoggedOutputEvent);
}
-}
+} \ No newline at end of file