Update new SDNR actor with v2.0 structures
[policy/models.git] / models-interactions / model-simulators / src / main / java / org / onap / policy / simulators / AppcLcmTopicServer.java
index df4cbb3..6b2eabe 100644 (file)
@@ -36,6 +36,15 @@ public class AppcLcmTopicServer extends TopicServer<AppcLcmDmaapWrapper> {
 
     @Override
     protected String process(AppcLcmDmaapWrapper request) {
+        /*
+         * In case the request and response are on the same topic, this may be invoked
+         * with a request or with a response object. If the "output" is not null, then we
+         * know it's a response.
+         */
+        if (request.getBody().getOutput() != null) {
+            return null;
+        }
+
         String response = ResourceUtils.getResourceAsString("org/onap/policy/simulators/appclcm/appc.lcm.success.json");
         return response.replace("${replaceMe}", request.getBody().getInput().getCommonHeader().getSubRequestId());
     }