remove unused uuid parameter 15/75815/1
authorLukasz Muszkieta <lukasz.muszkieta@nokia.com>
Tue, 15 Jan 2019 13:11:13 +0000 (14:11 +0100)
committerLukasz Muszkieta <lukasz.muszkieta@nokia.com>
Tue, 15 Jan 2019 13:11:13 +0000 (14:11 +0100)
Change-Id: I07793ddafdb8c23ff62ce282c413585c495751ab
Issue-ID: SO-729
Signed-off-by: Lukasz Muszkieta <lukasz.muszkieta@nokia.com>
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ReplaceVnfInfra.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVnfInfra.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/VnfCmBase.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/VnfConfigUpdate.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/VnfInPlaceUpdate.groovy
common/src/main/java/org/onap/so/client/aai/AAIRestClientI.java
common/src/main/java/org/onap/so/client/aai/AAIRestClientImpl.java
common/src/main/java/org/onap/so/client/aai/AAIUpdator.java
common/src/main/java/org/onap/so/client/aai/AAIUpdatorImpl.java
common/src/test/java/org/onap/so/client/aai/AAIUpdatorImplTest.java
common/src/test/java/org/onap/so/client/aai/AAIUpdatorTest.java

index 3a20992..671796f 100644 (file)
@@ -431,17 +431,16 @@ public class ReplaceVnfInfra extends VnfCmBase {
                execution.setVariable("failedActivity", "AAI")
 
                try {
-                       def transactionLoggingUuid = UUID.randomUUID().toString()
                        AAIRestClientImpl client = new AAIRestClientImpl()
                        AAIUpdatorImpl aaiUpdator = new AAIUpdatorImpl()
                        aaiUpdator.setClient(client)
                        def vnfId = execution.getVariable("vnfId")
                        if (inMaint) {
-                               aaiUpdator.updateVnfToLocked(vnfId, transactionLoggingUuid)
+                               aaiUpdator.updateVnfToLocked(vnfId)
                                execution.setVariable("rollbackSetVnfInMaintenanceFlag", true)
                        }
                        else {
-                               aaiUpdator.updateVnfToUnLocked(vnfId, transactionLoggingUuid)
+                               aaiUpdator.updateVnfToUnLocked(vnfId)
                        }
                                                        
                        msoLogger.trace('Exited ' + method)
@@ -451,7 +450,6 @@ public class ReplaceVnfInfra extends VnfCmBase {
                        msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
                        execution.setVariable("errorCode", "1002")
                        execution.setVariable("errorText", e.getMessage())
-                       //exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in setVnfInMaintFlagInAAI(): ' + e.getMessage())
                }
        }
        
index 8c1df9b..f8d73ce 100644 (file)
@@ -411,17 +411,16 @@ public class UpdateVnfInfra extends VnfCmBase {
                execution.setVariable("failedActivity", "AAI")
 
                try {
-                       def transactionLoggingUuid = UUID.randomUUID().toString()
                        AAIRestClientImpl client = new AAIRestClientImpl()
                        AAIUpdatorImpl aaiUpdator = new AAIUpdatorImpl()
                        aaiUpdator.setClient(client)
                        def vnfId = execution.getVariable("vnfId")
                        if (inMaint) {
-                               aaiUpdator.updateVnfToLocked(vnfId, transactionLoggingUuid)
+                               aaiUpdator.updateVnfToLocked(vnfId)
                                execution.setVariable("rollbackSetVnfInMaintenanceFlag", true)
                        }
                        else {
-                               aaiUpdator.updateVnfToUnLocked(vnfId, transactionLoggingUuid)
+                               aaiUpdator.updateVnfToUnLocked(vnfId)
                        }
                                                        
                        msoLogger.trace('Exited ' + method)
@@ -431,7 +430,6 @@ public class UpdateVnfInfra extends VnfCmBase {
                        msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
                        execution.setVariable("errorCode", "1002")
                        execution.setVariable("errorText", e.getMessage())
-                       //exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in setVnfInMaintFlagInAAI(): ' + e.getMessage())
                }
        }
        
index ae89fa5..4237a8d 100644 (file)
@@ -401,17 +401,16 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
                execution.setVariable("failedActivity", "AAI")
 
                try {
-                       def transactionLoggingUuid = UUID.randomUUID().toString()
                        AAIRestClientImpl client = new AAIRestClientImpl()
                        AAIUpdatorImpl aaiUpdator = new AAIUpdatorImpl()
                        aaiUpdator.setClient(client)
                        def vnfId = execution.getVariable("vnfId")
                        if (inMaint) {
-                               aaiUpdator.updateVnfToLocked(vnfId, transactionLoggingUuid)
+                               aaiUpdator.updateVnfToLocked(vnfId)
                                execution.setVariable("rollbackSetVnfInMaintenanceFlag", true)
                        }
                        else {
-                               aaiUpdator.updateVnfToUnLocked(vnfId, transactionLoggingUuid)
+                               aaiUpdator.updateVnfToUnLocked(vnfId)
                        }
                                                        
                        msoLogger.trace('Exited ' + method)
@@ -421,7 +420,6 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
                        msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
                        execution.setVariable("errorCode", "1002")
                        execution.setVariable("errorText", e.getMessage())
-                       //exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in setVnfInMaintFlagInAAI(): ' + e.getMessage())
                }
        }
        
index 7de3359..89f40ed 100644 (file)
@@ -310,17 +310,16 @@ public class VnfConfigUpdate extends VnfCmBase {
                execution.setVariable("failedActivity", "AAI")
 
                try {
-                       def transactionLoggingUuid = UUID.randomUUID().toString()
                        AAIRestClientImpl client = new AAIRestClientImpl()
                        AAIUpdatorImpl aaiUpdator = new AAIUpdatorImpl()
                        aaiUpdator.setClient(client)
                        def vnfId = execution.getVariable("vnfId")
                        if (inMaint) {
-                               aaiUpdator.updateVnfToLocked(vnfId, transactionLoggingUuid)
+                               aaiUpdator.updateVnfToLocked(vnfId)
                                execution.setVariable("rollbackSetVnfInMaintenanceFlag", true)
                        }
                        else {
-                               aaiUpdator.updateVnfToUnLocked(vnfId, transactionLoggingUuid)
+                               aaiUpdator.updateVnfToUnLocked(vnfId)
                        }
                                                        
                        msoLogger.trace('Exited ' + method)
@@ -330,7 +329,6 @@ public class VnfConfigUpdate extends VnfCmBase {
                        msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
                        execution.setVariable("errorCode", "1002")
                        execution.setVariable("errorText", e.getMessage())
-                       //exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in setVnfInMaintFlagInAAI(): ' + e.getMessage())
                }
        }
        
index f6788fb..84668a5 100644 (file)
@@ -330,17 +330,16 @@ public class VnfInPlaceUpdate extends VnfCmBase {
                execution.setVariable("failedActivity", "AAI")
 
                try {
-                       def transactionLoggingUuid = UUID.randomUUID().toString()
                        AAIRestClientImpl client = new AAIRestClientImpl()
                        AAIUpdatorImpl aaiUpdator = new AAIUpdatorImpl()
                        aaiUpdator.setClient(client)
                        def vnfId = execution.getVariable("vnfId")
                        if (inMaint) {
-                               aaiUpdator.updateVnfToLocked(vnfId, transactionLoggingUuid)
+                               aaiUpdator.updateVnfToLocked(vnfId)
                                execution.setVariable("rollbackSetVnfInMaintenanceFlag", true)
                        }
                        else {
-                               aaiUpdator.updateVnfToUnLocked(vnfId, transactionLoggingUuid)
+                               aaiUpdator.updateVnfToUnLocked(vnfId)
                        }
 
                        msoLogger.trace('Exited ' + method)
@@ -350,7 +349,6 @@ public class VnfInPlaceUpdate extends VnfCmBase {
                        msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
                        execution.setVariable("errorCode", "1002")
                        execution.setVariable("errorText", e.getMessage())
-                       //exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in setVnfInMaintFlagInAAI(): ' + e.getMessage())
                }
        }
 
index 52f15c4..785c82b 100644 (file)
@@ -31,7 +31,7 @@ public interface AAIRestClientI {
 
        List<Pserver> getPhysicalServerByVnfId(String vnfId) throws IOException;
        
-       void updateMaintenceFlagVnfId(String vnfId, boolean inMaint, String transactionLoggingUuid) throws Exception;
+       void updateMaintenceFlagVnfId(String vnfId, boolean inMaint) throws Exception;
        
        GenericVnf getVnfByName(String vnfId);
 
index c11b297..1c02409 100644 (file)
@@ -65,7 +65,7 @@ public class AAIRestClientImpl implements AAIRestClientI {
     }
 
     @Override
-    public void updateMaintenceFlagVnfId(String vnfId, boolean inMaint, String transactionLoggingUuid) {
+    public void updateMaintenceFlagVnfId(String vnfId, boolean inMaint) {
         GenericVnf genericVnf = new GenericVnf();
         genericVnf.setInMaint(inMaint);
         new AAIResourcesClient()
index 8921e4b..f7c9fe8 100644 (file)
 
 package org.onap.so.client.aai;
 
-import java.io.IOException;
-
 public interface AAIUpdator {
        
-       void updateVnfToLocked(String vnfName, String uuid) throws IOException, Exception;
+       void updateVnfToLocked(String vnfName) throws Exception;
        
-       void updateVnfToUnLocked(String vnfName, String uuid) throws IOException, Exception;
+       void updateVnfToUnLocked(String vnfName) throws Exception;
 
 }
index a971fde..2697e4a 100644 (file)
@@ -23,7 +23,6 @@ package org.onap.so.client.aai;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-
 public class AAIUpdatorImpl implements AAIUpdator {
        
        @Autowired
@@ -39,13 +38,13 @@ public class AAIUpdatorImpl implements AAIUpdator {
        }
 
        @Override
-       public void updateVnfToLocked(String vnfId, String uuid) throws Exception {
-               client.updateMaintenceFlagVnfId(vnfId, true, uuid);
+       public void updateVnfToLocked(String vnfId) throws Exception {
+               client.updateMaintenceFlagVnfId(vnfId, true);
        }
 
        @Override
-       public void updateVnfToUnLocked(String vnfId, String uuid) throws Exception {
-               client.updateMaintenceFlagVnfId(vnfId, false, uuid);
+       public void updateVnfToUnLocked(String vnfId) throws Exception {
+               client.updateMaintenceFlagVnfId(vnfId, false);
        }
 
 }
index 7ba92a1..fdfe41f 100644 (file)
@@ -41,13 +41,13 @@ public class AAIUpdatorImplTest {
 
     @Test(expected = NullPointerException.class)
     public void updateVnfToLockedTest() throws Exception {
-        test.updateVnfToLocked("vnfId","uuId");
+        test.updateVnfToLocked("vnfId");
     }
 
 
     @Test(expected = NullPointerException.class)
     public void updateVnfToUnLockedTest() throws Exception {
-        test.updateVnfToUnLocked("vnfId","uuId");
+        test.updateVnfToUnLocked("vnfId");
     }
 
 }
index 8989d6d..3fc9776 100644 (file)
@@ -36,7 +36,6 @@ public class AAIUpdatorTest {
        @Mock
        protected AAIRestClientI client;
        String vnfName = "testVnf";
-       String uuid = "UUID";
        AAIUpdatorImpl updator;
        
        @Before
@@ -47,15 +46,15 @@ public class AAIUpdatorTest {
 
        @Test
        public void testUpdateVnfToLocked() throws Exception{           
-               doNothing().when(client).updateMaintenceFlagVnfId(isA(String.class), isA(Boolean.class), isA(String.class));    
-               updator.updateVnfToLocked(vnfName, uuid);
-               verify(client, times(1)).updateMaintenceFlagVnfId(vnfName, true, uuid);
+               doNothing().when(client).updateMaintenceFlagVnfId(isA(String.class), isA(Boolean.class));
+               updator.updateVnfToLocked(vnfName);
+               verify(client, times(1)).updateMaintenceFlagVnfId(vnfName, true);
        }
        
        @Test
        public void testUpdateVnfToUnLocked() throws Exception {
-               doNothing().when(client).updateMaintenceFlagVnfId(isA(String.class), isA(Boolean.class), isA(String.class));    
-               updator.updateVnfToUnLocked(vnfName, uuid);
-               verify(client, times(1)).updateMaintenceFlagVnfId(vnfName, false, uuid);
+               doNothing().when(client).updateMaintenceFlagVnfId(isA(String.class), isA(Boolean.class));
+               updator.updateVnfToUnLocked(vnfName);
+               verify(client, times(1)).updateMaintenceFlagVnfId(vnfName, false);
        }
 }
\ No newline at end of file