diff options
11 files changed, 25 insertions, 6 deletions
diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloudify/exceptions/MsoCloudifyExceptionTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloudify/exceptions/MsoCloudifyExceptionTest.java index d45f685795..1506fda817 100644 --- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloudify/exceptions/MsoCloudifyExceptionTest.java +++ b/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloudify/exceptions/MsoCloudifyExceptionTest.java @@ -28,6 +28,7 @@ public class MsoCloudifyExceptionTest { MsoCloudifyException mcl = new MsoCloudifyException(200, "message", "detail", e); mce.setPendingWorkflow(pendingWorkflow); assert (mcl.toString() != null); + assertNotNull(mce); } } diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloudify/exceptions/MsoCloudifyTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloudify/exceptions/MsoCloudifyTest.java index 08b2356fdc..25dcae3c2c 100644 --- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloudify/exceptions/MsoCloudifyTest.java +++ b/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloudify/exceptions/MsoCloudifyTest.java @@ -24,6 +24,7 @@ public class MsoCloudifyTest { MsoBlueprintAlreadyExists mbae = new MsoBlueprintAlreadyExists("blueprintId", "cloud"); MsoCloudifyManagerNotFound mcm = new MsoCloudifyManagerNotFound("cloudSiteId"); MsoDeploymentAlreadyExists mdae = new MsoDeploymentAlreadyExists("deploymentId", "cloud"); + assertNotNull((mbae)); } } diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloudify/exceptions/MsoCloudifyTimeoutTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloudify/exceptions/MsoCloudifyTimeoutTest.java index 48c5c877a5..dc74d83d04 100644 --- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloudify/exceptions/MsoCloudifyTimeoutTest.java +++ b/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloudify/exceptions/MsoCloudifyTimeoutTest.java @@ -27,6 +27,7 @@ public class MsoCloudifyTimeoutTest { MsoCloudifyTimeout mct = new MsoCloudifyTimeout(execution); mct.getExecution(); assert (mct.toString() != null); + assertNotNull(mct); } } diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/beans/MsoTenantTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/beans/MsoTenantTest.java index ece5b21f19..3f2a6263d3 100644 --- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/beans/MsoTenantTest.java +++ b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/beans/MsoTenantTest.java @@ -15,6 +15,7 @@ package org.onap.so.openstack.beans; +import static org.junit.Assert.*; import java.util.HashMap; import java.util.Map; import org.junit.Test; @@ -32,5 +33,6 @@ public class MsoTenantTest { assert (ms.getMetadata().equals(map)); assert (ms.getTenantId().equals("tenantId")); assert (ms.getTenantName().equals("tenantName")); + assertNotNull(map); } } diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatEnvironmentParameterTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatEnvironmentParameterTest.java index 954f237ffe..de39df7b35 100644 --- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatEnvironmentParameterTest.java +++ b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatEnvironmentParameterTest.java @@ -17,6 +17,7 @@ package org.onap.so.openstack.utils; import static org.mockito.Mockito.mock; import org.junit.Test; +import static org.junit.Assert.*; public class MsoHeatEnvironmentParameterTest { @@ -35,6 +36,7 @@ public class MsoHeatEnvironmentParameterTest { // assertTrue(op.equals(hep)); meo.equals(op); meo.hashCode(); + assertNotNull(mea); } } diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tenant/exceptions/TenantAlreadyExistsTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tenant/exceptions/TenantAlreadyExistsTest.java index 6e3312b1d3..106a96a091 100644 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tenant/exceptions/TenantAlreadyExistsTest.java +++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tenant/exceptions/TenantAlreadyExistsTest.java @@ -16,6 +16,7 @@ package org.onap.so.adapters.tenant.exceptions; import org.junit.Test; +import static org.junit.Assert.*; public class TenantAlreadyExistsTest { @@ -23,5 +24,6 @@ public class TenantAlreadyExistsTest { public void test() { TenantAlreadyExists tar = new TenantAlreadyExists("name", "cloudId", "tenantId"); assert (tar != null); + assertNotNull(tar); } } diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tenant/exceptions/TenantExceptionBeanTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tenant/exceptions/TenantExceptionBeanTest.java index 7314a9f1e2..ece92b4ac0 100644 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tenant/exceptions/TenantExceptionBeanTest.java +++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tenant/exceptions/TenantExceptionBeanTest.java @@ -19,6 +19,7 @@ import org.junit.Test; import org.mockito.InjectMocks; import org.mockito.Mock; import org.onap.so.openstack.exceptions.MsoExceptionCategory; +import static org.junit.Assert.*; public class TenantExceptionBeanTest { @@ -38,5 +39,6 @@ public class TenantExceptionBeanTest { teb.setCategory(MsoExceptionCategory.USERDATA); assert (teb.getMessage().equals("message")); assert (teb.getCategory() != null); + assertNotNull(teb); } } diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tenant/exceptions/TenantExceptionTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tenant/exceptions/TenantExceptionTest.java index 83eb1f1bdc..1ce4c664ac 100644 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tenant/exceptions/TenantExceptionTest.java +++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tenant/exceptions/TenantExceptionTest.java @@ -19,6 +19,7 @@ import org.junit.Test; import org.mockito.InjectMocks; import org.mockito.Mock; import org.onap.so.openstack.exceptions.MsoExceptionCategory; +import static org.junit.Assert.*; public class TenantExceptionTest { @@ -40,5 +41,6 @@ public class TenantExceptionTest { te.setFaultInfo(teb); assert (te.getFaultInfo() != null); assert (te.getFaultInfo().equals(teb)); + assertNotNull(teb); } } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCommunicationService.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCommunicationService.groovy index 84da1e4ec9..26936bfd71 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCommunicationService.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCommunicationService.groovy @@ -199,7 +199,7 @@ class DeleteCommunicationService extends AbstractServiceTaskProcessor { * 再次调用deleteE2EServiceInstance接口,然后获取到operationid, */ void sendRequest2NSMFWF(DelegateExecution execution) { - LOGGER.trace("begin preRequestSend2NSMF") + LOGGER.debug("begin preRequestSend2NSMF") try { //url:/onap/so/infra/e2eServiceInstances/v3/{serviceInstanceId}" def NSMF_endpoint = UrnPropertiesReader.getVariable("mso.infra.endpoint.url", execution) @@ -213,9 +213,13 @@ class DeleteCommunicationService extends AbstractServiceTaskProcessor { """ requestBody.replaceAll("\\s+", "") - String basicAuthValue = UrnPropertiesReader.getVariable("mso.infra.endpoint.auth", execution) + String msoKey = UrnPropertiesReader.getVariable("mso.msoKey", execution) + String basicAuth = UrnPropertiesReader.getVariable("mso.infra.endpoint.auth", execution) + String basicAuthValue = utils.encrypt(basicAuth, msoKey) + String encodeString = utils.getBasicAuth(basicAuthValue, msoKey) + HttpClient httpClient = getHttpClientFactory().newJsonClient(new URL(url), ONAPComponents.SO) - httpClient.addAdditionalHeader("Authorization", basicAuthValue) + httpClient.addAdditionalHeader("Authorization", encodeString) httpClient.addAdditionalHeader("Accept", "application/json") Response httpResponse = httpClient.delete(requestBody) handleNSSMFWFResponse(httpResponse, execution) @@ -228,7 +232,7 @@ class DeleteCommunicationService extends AbstractServiceTaskProcessor { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } - LOGGER.trace("exit preRequestSend2NSMF") + LOGGER.debug("exit preRequestSend2NSMF") } /** diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIPnfResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIPnfResources.java index 7184bba377..3b22cd9d81 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIPnfResources.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIPnfResources.java @@ -98,7 +98,8 @@ public class AAIPnfResources { pnfFromAai.getPnfName()); } else { String errorMessage = String.format( - "pnf with name %s already exists with orchestration status %s, only status Inventoried allows to use existing pnf", + "pnf with name %s already exists with orchestration status %s, existing pnf can be used only " + + "if status is not set or set as Inventoried", pnfFromAai.getPnfName(), pnfFromAai.getOrchestrationStatus()); logger.error(errorMessage); throw new Exception(errorMessage); diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIPnfResourcesTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIPnfResourcesTest.java index 5e9b4c7592..59cd53edd5 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIPnfResourcesTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAIPnfResourcesTest.java @@ -149,7 +149,8 @@ public class AAIPnfResourcesTest extends TestDataSetup { } catch (Exception e) { // then assertThat(e.getMessage()).isEqualTo(String.format( - "pnf with name %s already exists with orchestration status Active, only status Inventoried allows to use existing pnf", + "pnf with name %s already exists with orchestration status Active, existing pnf can be used only " + + "if status is not set or set as Inventoried", PNF_NAME)); } } |