Fix sonar issues
[vfc/nfvo/driver/vnfm/svnfm.git] / nokiav2 / driver / src / test / java / org / onap / vfc / nfvo / driver / vnfm / svnfm / nokia / vnfm / notification / TestLifecycleChangeNotificationManager.java
index 922e92b..449217f 100644 (file)
@@ -426,6 +426,24 @@ public class TestLifecycleChangeNotificationManager extends TestBase {
         verify(logger).warn("Unable to send information related to affected connection points during forceful termination");
     }
 
+    /**
+     * Forceful termination results in an empty affected connection points
+     */
+    @Test
+    public void testGracefullTermination() {
+        //given
+        recievedLcn.setOperation(OperationType.INSTANTIATE);
+        recievedLcn.setStatus(OperationStatus.FINISHED);
+        recievedLcn.setLifecycleOperationOccurrenceId(terminationOperation.getId());
+        ((JsonObject) terminationOperation.getOperationParams()).addProperty("terminationType", "GRACEFUL");
+        addEmptyModifiedConnectionPoints(terminationOperation);
+        terminationOperation.setStatus(OperationStatus.FINISHED);
+        terminationOperation.setOperationType(OperationType.TERMINATE);
+        //when
+        lifecycleChangeNotificationManager.handleLcn(recievedLcn);
+        assertTrue(affectedConnectionPoints.getValue().isPresent());
+    }
+
     /**
      * Failures in affected connection point processing are tolerated for failed operation
      * (because the POST script was not able to run)