From 53791d7d6434eb5ae821cba4572a96796d65c2ee Mon Sep 17 00:00:00 2001 From: "waqas.ikram" Date: Thu, 30 May 2019 13:15:16 +0000 Subject: Fixing infinte loop of flow Change-Id: I80dc144750406d5afcec9b4da717a55a3840e503 Issue-ID: SO-1946 Signed-off-by: waqas.ikram --- .../adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'bpmn/so-bpmn-tasks/src/test') diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java index 7bd6435b60..e94d7c2923 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java @@ -228,7 +228,7 @@ public class VnfmAdapterServiceProviderImplTest { assertFalse(actual.isPresent()); } - @Test + @Test(expected = RestProcessingException.class) public void testGetInstantiateOperationJobStatus_Exception() { when(mockedHttpServiceProvider.getHttpResponse(eq(TestConstants.JOB_STATUS_EXPECTED_URL), @@ -237,8 +237,7 @@ public class VnfmAdapterServiceProviderImplTest { final VnfmAdapterServiceProvider objUnderTest = new VnfmAdapterServiceProviderImpl(getVnfmAdapterUrlProvider(), mockedHttpServiceProvider); - final Optional actual = objUnderTest.getInstantiateOperationJobStatus(DUMMY_JOB_ID); - assertFalse(actual.isPresent()); + objUnderTest.getInstantiateOperationJobStatus(DUMMY_JOB_ID); } private QueryJobResponse getQueryJobResponse() { -- cgit 1.2.3-korg From f5034c75fb4178791a51fd16e1322e80c05b44a8 Mon Sep 17 00:00:00 2001 From: "waqas.ikram" Date: Sun, 2 Jun 2019 15:24:20 +0000 Subject: Fixing EtSI BB ClassCastException Change-Id: Ia5a37f80392693f603d6597760ca9725882de169 Issue-ID: SO-1971 Signed-off-by: waqas.ikram --- .../BuildingBlock/MonitorVnfmCreateNodeStatus.bpmn | 2 +- .../BuildingBlock/MonitorVnfmDeleteNodeStatus.bpmn | 4 +- .../vnfm/tasks/MonitorInstantiateVnfmNodeTask.java | 53 +++++++++ .../vnfm/tasks/MonitorTerminateVnfmNodeTask.java | 53 +++++++++ .../adapter/vnfm/tasks/MonitorVnfmNodeTask.java | 53 ++++++--- .../exception/GenericVnfNotFoundException.java | 33 ++++++ .../tasks/MonitorInstantiateVnfmNodeTaskTest.java | 129 +++++++++++++++++++++ .../tasks/MonitorTerminateVnfmNodeTaskTest.java | 113 ++++++++++++++++++ .../adapter/vnfm/tasks/MonitorVnfmNodeJobTest.java | 111 ------------------ 9 files changed, 424 insertions(+), 127 deletions(-) create mode 100644 bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTask.java create mode 100644 bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorTerminateVnfmNodeTask.java create mode 100644 bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/exception/GenericVnfNotFoundException.java create mode 100644 bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTaskTest.java create mode 100644 bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorTerminateVnfmNodeTaskTest.java delete mode 100644 bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeJobTest.java (limited to 'bpmn/so-bpmn-tasks/src/test') diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmCreateNodeStatus.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmCreateNodeStatus.bpmn index e7d40e84b5..9712ca8ab7 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmCreateNodeStatus.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmCreateNodeStatus.bpmn @@ -24,7 +24,7 @@ SequenceFlow_1rxbeqi - + SequenceFlow_1moaz0q SequenceFlow_09t51ao SequenceFlow_0qvy3sn diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmDeleteNodeStatus.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmDeleteNodeStatus.bpmn index 8fababaffe..668cfaa44a 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmDeleteNodeStatus.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmDeleteNodeStatus.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_0spr34x @@ -28,7 +28,7 @@ ${execution.getVariable("deleteVnfNodeStatus")} - + SequenceFlow_17vvpzi SequenceFlow_11rfobu SequenceFlow_1unicf9 diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTask.java new file mode 100644 index 0000000000..b885cc2ee5 --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTask.java @@ -0,0 +1,53 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Ericsson. 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ +package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks; + +import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.CREATE_VNF_NODE_STATUS; +import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_CREATED; +import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; +import org.onap.so.client.exception.ExceptionBuilder; +import org.onap.so.client.orchestration.AAIVnfResources; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @author waqas.ikram@est.tech + * + */ +@Component +public class MonitorInstantiateVnfmNodeTask extends MonitorVnfmNodeTask { + + @Autowired + public MonitorInstantiateVnfmNodeTask(final ExtractPojosForBB extractPojosForBB, + final ExceptionBuilder exceptionUtil, final AAIVnfResources aaiVnfResources) { + super(extractPojosForBB, exceptionUtil, aaiVnfResources); + } + + @Override + public String getNodeStatusVariableName() { + return CREATE_VNF_NODE_STATUS; + } + + @Override + public boolean isOrchestrationStatusValid(final String orchestrationStatus) { + return VNF_CREATED.equalsIgnoreCase(orchestrationStatus); + } + +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorTerminateVnfmNodeTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorTerminateVnfmNodeTask.java new file mode 100644 index 0000000000..34296c20d6 --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorTerminateVnfmNodeTask.java @@ -0,0 +1,53 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Ericsson. 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ +package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks; + +import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.DELETE_VNF_NODE_STATUS; +import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_ASSIGNED; +import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; +import org.onap.so.client.exception.ExceptionBuilder; +import org.onap.so.client.orchestration.AAIVnfResources; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @author waqas.ikram@est.tech + * + */ +@Component +public class MonitorTerminateVnfmNodeTask extends MonitorVnfmNodeTask { + + @Autowired + public MonitorTerminateVnfmNodeTask(final ExtractPojosForBB extractPojosForBB, final ExceptionBuilder exceptionUtil, + final AAIVnfResources aaiVnfResources) { + super(extractPojosForBB, exceptionUtil, aaiVnfResources); + } + + @Override + public String getNodeStatusVariableName() { + return DELETE_VNF_NODE_STATUS; + } + + @Override + public boolean isOrchestrationStatusValid(final String orchestrationStatus) { + return VNF_ASSIGNED.equalsIgnoreCase(orchestrationStatus); + } + +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeTask.java index 65b05e21f5..a7a4eadb33 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeTask.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeTask.java @@ -19,38 +19,39 @@ */ package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks; -import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.CREATE_VNF_NODE_STATUS; -import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.DELETE_VNF_NODE_STATUS; -import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_ASSIGNED; -import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_CREATED; import static org.onap.so.bpmn.servicedecomposition.entities.ResourceKey.GENERIC_VNF_ID; +import java.util.Optional; import org.onap.aai.domain.yang.GenericVnf; import org.onap.so.bpmn.common.BuildingBlockExecution; +import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.exception.GenericVnfNotFoundException; import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; import org.onap.so.client.exception.ExceptionBuilder; +import org.onap.so.client.orchestration.AAIVnfResources; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; /** * * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech) + * @author Waqas Ikram (waqas.ikram@est.tech) * */ -@Component -public class MonitorVnfmNodeTask { +public abstract class MonitorVnfmNodeTask { private static final Logger LOGGER = LoggerFactory.getLogger(MonitorVnfmNodeTask.class); private final ExtractPojosForBB extractPojosForBB; private final ExceptionBuilder exceptionUtil; + private final AAIVnfResources aaiVnfResources; @Autowired - public MonitorVnfmNodeTask(final ExtractPojosForBB extractPojosForBB, final ExceptionBuilder exceptionUtil) { + public MonitorVnfmNodeTask(final ExtractPojosForBB extractPojosForBB, final ExceptionBuilder exceptionUtil, + final AAIVnfResources aaiVnfResources) { this.exceptionUtil = exceptionUtil; this.extractPojosForBB = extractPojosForBB; + this.aaiVnfResources = aaiVnfResources; } /** @@ -61,17 +62,43 @@ public class MonitorVnfmNodeTask { public void getNodeStatus(final BuildingBlockExecution execution) { try { LOGGER.debug("Executing getNodeStatus ..."); - final GenericVnf vnf = extractPojosForBB.extractByKey(execution, GENERIC_VNF_ID); - String orchestrationStatus = vnf.getOrchestrationStatus(); - LOGGER.debug("Orchestration Status in AAI {}", orchestrationStatus); - execution.setVariable(CREATE_VNF_NODE_STATUS, VNF_CREATED.equalsIgnoreCase(orchestrationStatus)); - execution.setVariable(DELETE_VNF_NODE_STATUS, VNF_ASSIGNED.equalsIgnoreCase(orchestrationStatus)); + + final org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf = + extractPojosForBB.extractByKey(execution, GENERIC_VNF_ID); + + final String vnfId = vnf.getVnfId(); + LOGGER.debug("Query A&AI for generic VNF using vnfID: {}", vnfId); + final Optional aaiGenericVnfOptional = aaiVnfResources.getGenericVnf(vnfId); + + if (!aaiGenericVnfOptional.isPresent()) { + throw new GenericVnfNotFoundException("Unable to find generic vnf in A&AI using vnfID: " + vnfId); + } + final GenericVnf genericVnf = aaiGenericVnfOptional.get(); + final String orchestrationStatus = genericVnf.getOrchestrationStatus(); + LOGGER.debug("Found generic vnf with orchestration status : {}", orchestrationStatus); + + execution.setVariable(getNodeStatusVariableName(), isOrchestrationStatusValid(orchestrationStatus)); + } catch (final Exception exception) { LOGGER.error("Unable to get vnf from AAI", exception); exceptionUtil.buildAndThrowWorkflowException(execution, 1220, exception); } } + /** + * Get variable to store in execution context + * + * @return the variable name + */ + public abstract String getNodeStatusVariableName(); + + /** + * @param orchestrationStatus the orchestration status from A&AI + * @return true if valid + */ + public abstract boolean isOrchestrationStatusValid(final String orchestrationStatus); + + /** * Log and throw exception on timeout for job status * diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/exception/GenericVnfNotFoundException.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/exception/GenericVnfNotFoundException.java new file mode 100644 index 0000000000..d33d0bc895 --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/exception/GenericVnfNotFoundException.java @@ -0,0 +1,33 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Ericsson. 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ +package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.exception; + +/** + * @author waqas.ikram@est.tech + * + */ +public class GenericVnfNotFoundException extends Exception { + private static final long serialVersionUID = -2049370314818025597L; + + public GenericVnfNotFoundException(final String message) { + super(message); + } + +} diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTaskTest.java new file mode 100644 index 0000000000..effcf24a8d --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTaskTest.java @@ -0,0 +1,129 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks; + +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.CREATE_VNF_NODE_STATUS; +import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_CREATED; +import java.util.Optional; +import java.util.UUID; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.onap.aai.domain.yang.GenericVnf; +import org.onap.so.bpmn.BaseTaskTest; +import org.onap.so.bpmn.common.BuildingBlockExecution; +import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; +import org.onap.so.client.orchestration.AAIVnfResources; + +/** + * + * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech) + * @author Waqas Ikram (waqas.ikram@est.tech) + * + */ +public class MonitorInstantiateVnfmNodeTaskTest extends BaseTaskTest { + + private static final String VNF_ID = UUID.randomUUID().toString(); + + private static final String VNF_NAME = "VNF_NAME"; + + private MonitorVnfmNodeTask objUnderTest; + + @Mock + private VnfmAdapterServiceProvider mockedVnfmAdapterServiceProvider; + + @Mock + private AAIVnfResources mockedAaiVnfResources; + + private final BuildingBlockExecution stubbedxecution = new StubbedBuildingBlockExecution(); + + @Before + public void setUp() { + objUnderTest = getEtsiVnfMonitorNodeJobTask(); + } + + @Test + public void testGetNodeStatus_genericVnfWithOrchStatusCreated_executionVariableSetToCreate() throws Exception { + final org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf = getGenericVnf(); + final GenericVnf aaiGenericVnf = getAAIGenericVnf(); + aaiGenericVnf.setOrchestrationStatus(VNF_CREATED); + + when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(vnf); + when(mockedAaiVnfResources.getGenericVnf(eq(VNF_ID))).thenReturn(Optional.of(aaiGenericVnf)); + objUnderTest.getNodeStatus(stubbedxecution); + assertTrue(stubbedxecution.getVariable(CREATE_VNF_NODE_STATUS)); + } + + @Test + public void testGetNodeStatus_noGenericVnfFoundInAAI_throwException() throws Exception { + final org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf = getGenericVnf(); + + when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(vnf); + when(mockedAaiVnfResources.getGenericVnf(eq(VNF_ID))).thenReturn(Optional.empty()); + objUnderTest.getNodeStatus(stubbedxecution); + verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1220), + any(Exception.class)); + assertNull(stubbedxecution.getVariable(CREATE_VNF_NODE_STATUS)); + + } + + @Test + public void testGetNodeStatusException() throws Exception { + when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenThrow(RuntimeException.class); + objUnderTest.getNodeStatus(stubbedxecution); + assertNull(stubbedxecution.getVariable(CREATE_VNF_NODE_STATUS)); + verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1220), + any(Exception.class)); + } + + @Test + public void testTimeOutLogFailue() throws Exception { + objUnderTest.timeOutLogFailue(stubbedxecution); + verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1221), + eq("Node operation time out")); + } + + private GenericVnf getAAIGenericVnf() { + final GenericVnf genericVnf = new GenericVnf(); + genericVnf.setVnfId(VNF_ID); + genericVnf.setVnfName(VNF_NAME); + return genericVnf; + } + + private org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf getGenericVnf() { + final org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf genericVnf = + new org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf(); + genericVnf.setVnfId(VNF_ID); + return genericVnf; + + } + + private MonitorInstantiateVnfmNodeTask getEtsiVnfMonitorNodeJobTask() { + return new MonitorInstantiateVnfmNodeTask(extractPojosForBB, exceptionUtil, mockedAaiVnfResources); + } + +} diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorTerminateVnfmNodeTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorTerminateVnfmNodeTaskTest.java new file mode 100644 index 0000000000..04831733e1 --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorTerminateVnfmNodeTaskTest.java @@ -0,0 +1,113 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks; + +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.DELETE_VNF_NODE_STATUS; +import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_ASSIGNED; +import java.util.Optional; +import java.util.UUID; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.onap.aai.domain.yang.GenericVnf; +import org.onap.so.bpmn.BaseTaskTest; +import org.onap.so.bpmn.common.BuildingBlockExecution; +import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; +import org.onap.so.client.orchestration.AAIVnfResources; + +/** + * + * @author Waqas Ikram (waqas.ikram@est.tech) + * + */ +public class MonitorTerminateVnfmNodeTaskTest extends BaseTaskTest { + + private static final String VNF_ID = UUID.randomUUID().toString(); + + private static final String VNF_NAME = "VNF_NAME"; + + private MonitorVnfmNodeTask objUnderTest; + + @Mock + private VnfmAdapterServiceProvider mockedVnfmAdapterServiceProvider; + + @Mock + private AAIVnfResources mockedAaiVnfResources; + + private final BuildingBlockExecution stubbedxecution = new StubbedBuildingBlockExecution(); + + @Before + public void setUp() { + objUnderTest = getEtsiVnfMonitorNodeJobTask(); + } + + @Test + public void testGetNodeStatusDelete() throws Exception { + final org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf = getGenericVnf(); + final GenericVnf aaiGenericVnf = getAAIGenericVnf(); + aaiGenericVnf.setOrchestrationStatus(VNF_ASSIGNED); + + when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(vnf); + when(mockedAaiVnfResources.getGenericVnf(eq(VNF_ID))).thenReturn(Optional.of(aaiGenericVnf)); + + objUnderTest.getNodeStatus(stubbedxecution); + assertTrue(stubbedxecution.getVariable(DELETE_VNF_NODE_STATUS)); + } + + @Test + public void testGetNodeStatus_noGenericVnfFoundInAAI_throwException() throws Exception { + final org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf = getGenericVnf(); + + when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(vnf); + when(mockedAaiVnfResources.getGenericVnf(eq(VNF_ID))).thenReturn(Optional.empty()); + objUnderTest.getNodeStatus(stubbedxecution); + verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1220), + any(Exception.class)); + assertNull(stubbedxecution.getVariable(DELETE_VNF_NODE_STATUS)); + + } + + private GenericVnf getAAIGenericVnf() { + final GenericVnf genericVnf = new GenericVnf(); + genericVnf.setVnfId(VNF_ID); + genericVnf.setVnfName(VNF_NAME); + return genericVnf; + } + + private org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf getGenericVnf() { + final org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf genericVnf = + new org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf(); + genericVnf.setVnfId(VNF_ID); + return genericVnf; + + } + + private MonitorTerminateVnfmNodeTask getEtsiVnfMonitorNodeJobTask() { + return new MonitorTerminateVnfmNodeTask(extractPojosForBB, exceptionUtil, mockedAaiVnfResources); + } + +} diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeJobTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeJobTest.java deleted file mode 100644 index 6b84f6a918..0000000000 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeJobTest.java +++ /dev/null @@ -1,111 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks; - -import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.CREATE_VNF_NODE_STATUS; -import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.DELETE_VNF_NODE_STATUS; -import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_CREATED; -import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_ASSIGNED; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import java.util.UUID; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mock; -import org.onap.aai.domain.yang.GenericVnf; -import org.onap.so.bpmn.BaseTaskTest; -import org.onap.so.bpmn.common.BuildingBlockExecution; -import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; - -/** - * - * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech) - * - */ -public class MonitorVnfmNodeJobTest extends BaseTaskTest { - - private static final String VNF_ID = UUID.randomUUID().toString(); - - private static final String VNF_NAME = "VNF_NAME"; - - private MonitorVnfmNodeTask objUnderTest; - - @Mock - private VnfmAdapterServiceProvider mockedVnfmAdapterServiceProvider; - - private final BuildingBlockExecution stubbedxecution = new StubbedBuildingBlockExecution(); - - @Before - public void setUp() { - objUnderTest = getEtsiVnfMonitorNodeJobTask(); - } - - @Test - public void testGetNodeStatusCreate() throws Exception { - GenericVnf vnf = getGenericVnf(); - vnf.setOrchestrationStatus(VNF_CREATED); - when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(vnf); - objUnderTest.getNodeStatus(stubbedxecution); - assertTrue(stubbedxecution.getVariable(CREATE_VNF_NODE_STATUS)); - } - - @Test - public void testGetNodeStatusDelete() throws Exception { - GenericVnf vnf = getGenericVnf(); - vnf.setOrchestrationStatus(VNF_ASSIGNED); - when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(vnf); - objUnderTest.getNodeStatus(stubbedxecution); - assertTrue(stubbedxecution.getVariable(DELETE_VNF_NODE_STATUS)); - } - - @Test - public void testGetNodeStatusException() throws Exception { - when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenThrow(RuntimeException.class); - objUnderTest.getNodeStatus(stubbedxecution); - assertNull(stubbedxecution.getVariable(CREATE_VNF_NODE_STATUS)); - assertNull(stubbedxecution.getVariable(DELETE_VNF_NODE_STATUS)); - verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1220), - any(Exception.class)); - } - - @Test - public void testTimeOutLogFailue() throws Exception { - objUnderTest.timeOutLogFailue(stubbedxecution); - verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1221), - eq("Node operation time out")); - } - - private GenericVnf getGenericVnf() { - final GenericVnf genericVnf = new GenericVnf(); - genericVnf.setVnfId(VNF_ID); - genericVnf.setVnfName(VNF_NAME); - return genericVnf; - } - - private MonitorVnfmNodeTask getEtsiVnfMonitorNodeJobTask() { - return new MonitorVnfmNodeTask(extractPojosForBB, exceptionUtil); - } - -} -- cgit 1.2.3-korg From b50847def6ec0a4912f06e7b57b3b316bd2f8e02 Mon Sep 17 00:00:00 2001 From: sunilb Date: Wed, 5 Jun 2019 05:00:15 +0530 Subject: Fix ConfigAssign/Deploy null return of BlueprintName/Version Fix ConfigAssign/Deploy null return of BlueprintName/Version Issue-ID: SO-1985 Signed-off-by: sunilb Change-Id: I15b6d38a21320eae6ca58a1e3d515813b9c243fd --- .../modelinfo/ModelInfoGenericVnf.java | 19 +++++++++++++++ .../ModelInfoGenericVnfExpected.json | 4 +++- .../VnfResourceCustomizationInput.json | 2 ++ .../flowspecific/tasks/ConfigAssignVnf.java | 5 ++-- .../flowspecific/tasks/ConfigDeployVnf.java | 6 +++-- .../workflow/tasks/WorkflowActionBBTasks.java | 5 ++-- .../workflow/tasks/WorkflowActionBBTasksTest.java | 28 ++++++++++++---------- 7 files changed, 49 insertions(+), 20 deletions(-) (limited to 'bpmn/so-bpmn-tasks/src/test') diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoGenericVnf.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoGenericVnf.java index 14327a3583..a558057979 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoGenericVnf.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/modelinfo/ModelInfoGenericVnf.java @@ -55,7 +55,26 @@ public class ModelInfoGenericVnf extends ModelInfoMetadata implements Serializab private String MultiStageDesign; @JsonProperty("created") private String Created; + @JsonProperty("blueprintName") + private String blueprintName; + @JsonProperty("blueprintVersion") + private String blueprintVersion; + public String getBlueprintName() { + return blueprintName; + } + + public void setBlueprintName(String blueprintName) { + this.blueprintName = blueprintName; + } + + public String getBlueprintVersion() { + return blueprintVersion; + } + + public void setBlueprintVersion(String blueprintVersion) { + this.blueprintVersion = blueprintVersion; + } public String getToscaNodeType() { return ToscaNodeType; diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/ModelInfoGenericVnfExpected.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/ModelInfoGenericVnfExpected.json index 98f966e753..9703b9c105 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/ModelInfoGenericVnfExpected.json +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/ModelInfoGenericVnfExpected.json @@ -17,5 +17,7 @@ "model-version" : "modelVersion", "model-invariant-uuid" : "modelInvariantUUID", "model-name" : "modelName", - "model-uuid" : "modelUUID" + "model-uuid" : "modelUUID", + "blueprintName" : "testBlueprintName", + "blueprintVersion" : "testBlueprintVersion" } \ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/VnfResourceCustomizationInput.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/VnfResourceCustomizationInput.json index 26516ce907..95b116cec8 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/VnfResourceCustomizationInput.json +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/ExecuteBuildingBlock/VnfResourceCustomizationInput.json @@ -9,6 +9,8 @@ "nfRole" : "nfRole", "nfNamingCode" : "nfNamingCode", "multiStageDesign" : "multiStageDesign", + "blueprintName" : "testBlueprintName", + "blueprintVersion" : "testBlueprintVersion", "vnfResources" : { "modelUUID" : "modelUUID", "modelInvariantUUID" : "modelInvariantUUID", diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnf.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnf.java index b2058b25a0..bc71fc6f67 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnf.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigAssignVnf.java @@ -91,8 +91,9 @@ public class ConfigAssignVnf { configAssignRequestVnf.setResolutionKey(vnf.getVnfName()); configAssignRequestVnf.setConfigAssignPropertiesForVnf(configAssignPropertiesForVnf); - String blueprintName = vnf.getBlueprintName(); - String blueprintVersion = vnf.getBlueprintVersion(); + String blueprintName = vnf.getModelInfoGenericVnf().getBlueprintName(); + String blueprintVersion = vnf.getModelInfoGenericVnf().getBlueprintVersion(); + logger.debug(" BlueprintName : " + blueprintName + " BlueprintVersion : " + blueprintVersion); AbstractCDSPropertiesBean abstractCDSPropertiesBean = new AbstractCDSPropertiesBean(); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigDeployVnf.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigDeployVnf.java index 359f19285f..6e7ca5f4e5 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigDeployVnf.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigDeployVnf.java @@ -92,8 +92,10 @@ public class ConfigDeployVnf { configDeployRequestVnf.setResolutionKey(vnf.getVnfName()); configDeployRequestVnf.setConfigDeployPropertiesForVnf(configDeployPropertiesForVnf); - String blueprintName = vnf.getBlueprintName(); - String blueprintVersion = vnf.getBlueprintVersion(); + String blueprintName = vnf.getModelInfoGenericVnf().getBlueprintName(); + String blueprintVersion = vnf.getModelInfoGenericVnf().getBlueprintVersion(); + logger.debug(" BlueprintName : " + blueprintName + " BlueprintVersion : " + blueprintVersion); + AbstractCDSPropertiesBean abstractCDSPropertiesBean = new AbstractCDSPropertiesBean(); abstractCDSPropertiesBean.setBlueprintName(blueprintName); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java index f0a102dfeb..8ec283032f 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java @@ -87,11 +87,10 @@ public class WorkflowActionBBTasks { if (ebb.getBuildingBlock().getBpmnFlowName().equals("ConfigAssignVnfBB") || ebb.getBuildingBlock().getBpmnFlowName().equals("ConfigDeployVnfBB")) { - String serviceInstanceId = ebb.getWorkflowResourceIds().getServiceInstanceId(); String vnfCustomizationUUID = ebb.getBuildingBlock().getKey(); - List vnfResourceCustomizations = - catalogDbClient.getVnfResourceCustomizationByModelUuid(serviceInstanceId); + List vnfResourceCustomizations = catalogDbClient + .getVnfResourceCustomizationByModelUuid(ebb.getRequestDetails().getModelInfo().getModelUuid()); if (vnfResourceCustomizations != null && vnfResourceCustomizations.size() >= 1) { VnfResourceCustomization vrc = catalogDbClient.findVnfResourceCustomizationInList(vnfCustomizationUUID, vnfResourceCustomizations); diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java index a60927d694..1013cc8330 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java @@ -48,6 +48,8 @@ import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock; import org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds; import org.onap.so.db.catalog.beans.VnfResourceCustomization; import org.onap.so.db.request.beans.InfraActiveRequests; +import org.onap.so.serviceinstancebeans.ModelInfo; +import org.onap.so.serviceinstancebeans.RequestDetails; import org.springframework.core.env.Environment; public class WorkflowActionBBTasksTest extends BaseTaskTest { @@ -95,14 +97,16 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest { ExecuteBuildingBlock ebb = new ExecuteBuildingBlock(); String vnfCustomizationUUID = "1234567"; - String serviceInstanceId = "1234567"; + String modelUuid = "1234567"; BuildingBlock buildingBlock = new BuildingBlock(); buildingBlock.setBpmnFlowName("ConfigAssignVnfBB"); buildingBlock.setKey(vnfCustomizationUUID); ebb.setBuildingBlock(buildingBlock); - WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds(); - workflowResourceIds.setServiceInstanceId(serviceInstanceId); - ebb.setWorkflowResourceIds(workflowResourceIds); + RequestDetails rd = new RequestDetails(); + ModelInfo mi = new ModelInfo(); + mi.setModelUuid(modelUuid); + rd.setModelInfo(mi); + ebb.setRequestDetails(rd); flowsToExecute.add(ebb); List vnfResourceCustomizations = new ArrayList(); @@ -112,8 +116,7 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest { vnfResourceCustomizations.add(vrc); GenericVnf genericVnf = new GenericVnf(); genericVnf.setModelCustomizationId(vnfCustomizationUUID); - doReturn(vnfResourceCustomizations).when(catalogDbClient) - .getVnfResourceCustomizationByModelUuid(serviceInstanceId); + doReturn(vnfResourceCustomizations).when(catalogDbClient).getVnfResourceCustomizationByModelUuid(modelUuid); doReturn(vrc).when(catalogDbClient).findVnfResourceCustomizationInList(vnfCustomizationUUID, vnfResourceCustomizations); @@ -138,14 +141,16 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest { ExecuteBuildingBlock ebb2 = new ExecuteBuildingBlock(); String vnfCustomizationUUID = "1234567"; - String serviceInstanceId = "1234567"; + String modelUuid = "1234567"; BuildingBlock buildingBlock = new BuildingBlock(); buildingBlock.setBpmnFlowName("ConfigDeployVnfBB"); buildingBlock.setKey(vnfCustomizationUUID); ebb.setBuildingBlock(buildingBlock); - WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds(); - workflowResourceIds.setServiceInstanceId(serviceInstanceId); - ebb.setWorkflowResourceIds(workflowResourceIds); + RequestDetails rd = new RequestDetails(); + ModelInfo mi = new ModelInfo(); + mi.setModelUuid(modelUuid); + rd.setModelInfo(mi); + ebb.setRequestDetails(rd); flowsToExecute.add(ebb); List vnfResourceCustomizations = new ArrayList(); @@ -155,8 +160,7 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest { vnfResourceCustomizations.add(vrc); GenericVnf genericVnf = new GenericVnf(); genericVnf.setModelCustomizationId(vnfCustomizationUUID); - doReturn(vnfResourceCustomizations).when(catalogDbClient) - .getVnfResourceCustomizationByModelUuid(serviceInstanceId); + doReturn(vnfResourceCustomizations).when(catalogDbClient).getVnfResourceCustomizationByModelUuid(modelUuid); doReturn(vrc).when(catalogDbClient).findVnfResourceCustomizationInList(vnfCustomizationUUID, vnfResourceCustomizations); -- cgit 1.2.3-korg