aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2018-07-30 15:56:09 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2018-07-31 11:09:25 -0400
commit5a6a6de6f1a26a1897e4917a0df613e25a24eb70 (patch)
tree59a968f27b4b603aacc9d5e7b51fb598aeec5321 /bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client
parentb6dc38501f3b746426b42d9de4cc883d894149e8 (diff)
Containerization feature of SO
Change-Id: I95381232eeefcd247a66a5cec370a8ce1c288e18 Issue-ID: SO-670 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client')
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/ResponseExceptionMapperImplTest.java111
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/network/NetworkAdapterClientTest.java146
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/requests/db/RequestsDbAdapterClientTest.java50
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/requests/db/entities/MsoRequestsDbExceptionBeanTest.java33
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/requests/db/entities/MsoRequestsDbExceptionTest.java37
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/requests/db/entities/UpdateInfraRequestTest.java64
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/vnf/VnfAdapterClientTest.java156
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerClientTest.java113
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerOrchestratorTest.java73
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerSupportTest.java84
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/policy/CommonObjectMapperProviderTest.java44
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/beans/SDNCRequestTest.java53
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/CallbackHeaderTest.java42
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/ObjectFactoryTest.java39
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/RequestHeaderTest.java45
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/RequestTunablesTest.java58
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/SDNCAdapterCallbackRequestTest.java41
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/SDNCAdapterRequestTest.java39
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/SDNCResponseTest.java43
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sndc/SDNCOrchTest.java82
20 files changed, 0 insertions, 1353 deletions
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/ResponseExceptionMapperImplTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/ResponseExceptionMapperImplTest.java
deleted file mode 100644
index 8943014ad0..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/ResponseExceptionMapperImplTest.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.client;
-
-import static org.assertj.core.api.Assertions.assertThatCode;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import com.google.common.base.Charsets;
-import javax.ws.rs.BadRequestException;
-import javax.ws.rs.ForbiddenException;
-import javax.ws.rs.InternalServerErrorException;
-import javax.ws.rs.NotAcceptableException;
-import javax.ws.rs.NotAllowedException;
-import javax.ws.rs.NotAuthorizedException;
-import javax.ws.rs.NotFoundException;
-import javax.ws.rs.NotSupportedException;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.client.ClientResponseContext;
-import javax.ws.rs.core.Response.Status;
-import junitparams.JUnitParamsRunner;
-import junitparams.Parameters;
-import org.apache.commons.io.IOUtils;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(JUnitParamsRunner.class)
-public class ResponseExceptionMapperImplTest {
-
- private static final ResponseExceptionMapperImpl mapper = new ResponseExceptionMapperImpl();
-
- public static Object[][] statusesAndCorrespondingExceptions() {
- return new Object[][]{
- {Status.BAD_REQUEST, BadRequestException.class},
- {Status.UNAUTHORIZED, NotAuthorizedException.class},
- {Status.FORBIDDEN, ForbiddenException.class},
- {Status.NOT_FOUND, NotFoundException.class},
- {Status.METHOD_NOT_ALLOWED, NotAllowedException.class},
- {Status.NOT_ACCEPTABLE, NotAcceptableException.class},
- {Status.PRECONDITION_FAILED, PreconditionFailedException.class},
- {Status.UNSUPPORTED_MEDIA_TYPE, NotSupportedException.class},
- {Status.INTERNAL_SERVER_ERROR, InternalServerErrorException.class},
- {Status.SERVICE_UNAVAILABLE, WebApplicationException.class},
- {Status.BAD_GATEWAY, WebApplicationException.class},
- };
- }
-
- @Test
- @Parameters(method = "statusesAndCorrespondingExceptions")
- public void shouldThrowExceptionWhenStatusIsNotOk(Status status, Class<Exception> expectedException) {
- // given
- ClientResponseContext responseContext = createMockResponseContext(status);
- // when, then
- assertThatThrownBy(() -> mapper.filter(null, responseContext)).isInstanceOf(expectedException);
- }
-
- @Test
- public void shouldNotThrowExceptionWhenStatusIsOk() {
- // given
- ClientResponseContext responseContext = createMockResponseContext(Status.OK);
- // when, then
- assertThatCode(() -> mapper.filter(null, responseContext)).doesNotThrowAnyException();
- }
-
- @Test
- public void shouldThrowExceptionWithCustomMessageWhenResponseHasEntity() {
- // given
- ClientResponseContext responseContext = createMockResponseContext(Status.BAD_REQUEST);
- when(responseContext.hasEntity()).thenReturn(true);
- when(responseContext.getEntityStream()).thenReturn(IOUtils.toInputStream("test message", Charsets.UTF_8));
- // when, then
- assertThatThrownBy(() -> mapper.filter(null, responseContext)).isInstanceOf(BadRequestException.class)
- .hasMessage("test message");
- }
-
- @Test
- public void shouldThrowExceptionWithDefaultMessageWhenResponseHasNoEntity() {
- // given
- ClientResponseContext responseContext = createMockResponseContext(Status.BAD_REQUEST);
- when(responseContext.hasEntity()).thenReturn(false);
- // when, then
- assertThatThrownBy(() -> mapper.filter(null, responseContext)).isInstanceOf(BadRequestException.class)
- .hasMessage("empty message");
- }
-
- private static ClientResponseContext createMockResponseContext(Status status) {
- ClientResponseContext responseContext = mock(ClientResponseContext.class);
- when(responseContext.getStatusInfo()).thenReturn(status);
- when(responseContext.getStatus()).thenReturn(status.getStatusCode());
- return responseContext;
- }
-} \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/network/NetworkAdapterClientTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/network/NetworkAdapterClientTest.java
deleted file mode 100644
index 0584bea012..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/network/NetworkAdapterClientTest.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.client.adapter.network;
-
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.equalTo;
-import static com.github.tomakehurst.wiremock.client.WireMock.get;
-import static com.github.tomakehurst.wiremock.client.WireMock.post;
-import static com.github.tomakehurst.wiremock.client.WireMock.put;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
-import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
-import static org.junit.Assert.assertEquals;
-
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.Test;
-import org.openecomp.mso.adapters.nwrest.CreateNetworkRequest;
-import org.openecomp.mso.adapters.nwrest.CreateNetworkResponse;
-import org.openecomp.mso.adapters.nwrest.DeleteNetworkRequest;
-import org.openecomp.mso.adapters.nwrest.DeleteNetworkResponse;
-import org.openecomp.mso.adapters.nwrest.QueryNetworkResponse;
-import org.openecomp.mso.adapters.nwrest.RollbackNetworkRequest;
-import org.openecomp.mso.adapters.nwrest.RollbackNetworkResponse;
-import org.openecomp.mso.adapters.nwrest.UpdateNetworkRequest;
-import org.openecomp.mso.adapters.nwrest.UpdateNetworkResponse;
-import org.openecomp.mso.openstack.beans.NetworkRollback;
-
-import com.github.tomakehurst.wiremock.junit.WireMockRule;
-
-public class NetworkAdapterClientTest {
-
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().port(28090));
-
- private static final String TESTING_ID = "___TESTING___";
- private static final String AAI_NETWORK_ID = "test";
- private static final String REST_ENDPOINT = "/networks/rest/v1/networks";
-
- private NetworkAdapterClientImpl client = new NetworkAdapterClientImpl();
-
- @BeforeClass
- public static void setUp() {
- System.setProperty("mso.config.path", "src/test/resources");
- }
-
- @Test
- public void createNetworkTest() {
- CreateNetworkRequest request = new CreateNetworkRequest();
- request.setCloudSiteId(TESTING_ID);
-
- CreateNetworkResponse mockResponse = new CreateNetworkResponse();
- mockResponse.setNetworkCreated(true);
- wireMockRule.stubFor(post(urlPathEqualTo(REST_ENDPOINT)).willReturn(aResponse()
- .withHeader("Content-Type", "application/json").withBody(mockResponse.toJsonString()).withStatus(200)));
-
- CreateNetworkResponse response = client.createNetwork(request);
- assertEquals("Testing CreateVfModule response", true, response.getNetworkCreated());
- }
-
- @Test
- public void deleteNetworkTest() {
- DeleteNetworkRequest request = new DeleteNetworkRequest();
- request.setCloudSiteId(TESTING_ID);
-
- DeleteNetworkResponse mockResponse = new DeleteNetworkResponse();
- mockResponse.setNetworkDeleted(true);
-
- wireMockRule.stubFor(put(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID)).willReturn(aResponse()
- .withHeader("Content-Type", "application/json").withBody(mockResponse.toJsonString()).withStatus(200)));
-
- DeleteNetworkResponse response = client.deleteNetwork(AAI_NETWORK_ID, request);
- assertEquals("Testing DeleteVfModule response", true, response.getNetworkDeleted());
- }
-
- @Test
- public void rollbackNetworkTest() {
- RollbackNetworkRequest request = new RollbackNetworkRequest();
- NetworkRollback rollback = new NetworkRollback();
- rollback.setCloudId(TESTING_ID);
- request.setNetworkRollback(rollback);
-
- RollbackNetworkResponse mockResponse = new RollbackNetworkResponse();
- mockResponse.setNetworkRolledBack(true);
-
- wireMockRule.stubFor(put(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID)).willReturn(aResponse()
- .withHeader("Content-Type", "application/json").withBody(mockResponse.toJsonString()).withStatus(200)));
-
- RollbackNetworkResponse response = client.rollbackNetwork(AAI_NETWORK_ID, request);
- assertEquals("Testing DeleteVfModule response", true, response.getNetworkRolledBack());
- }
-
- @Test
- public void queryNetworkTest() {
- QueryNetworkResponse mockResponse = new QueryNetworkResponse();
- mockResponse.setNetworkExists(true);
-
- wireMockRule.stubFor(get(urlPathEqualTo(REST_ENDPOINT))
- .withQueryParam("cloudSiteId", equalTo(TESTING_ID))
- .withQueryParam("tenantId", equalTo(TESTING_ID))
- .withQueryParam("networkStackId", equalTo("networkStackId"))
- .withQueryParam("skipAAI", equalTo("true"))
- .withQueryParam("msoRequest.requestId", equalTo("testRequestId"))
- .withQueryParam("msoRequest.serviceInstanceId", equalTo("serviceInstanceId"))
- .willReturn(aResponse()
- .withHeader("Content-Type", "application/json").withBody(mockResponse.toJsonString()).withStatus(200)));
-
- QueryNetworkResponse response = client.queryNetwork(AAI_NETWORK_ID, TESTING_ID, TESTING_ID,
- "networkStackId", true, "testRequestId", "serviceInstanceId");
- assertEquals("Testing QueryVfModule response", true, response.getNetworkExists());
- }
-
- @Ignore
- @Test
- public void updateNetworkTest() {
- UpdateNetworkRequest request = new UpdateNetworkRequest();
- request.setCloudSiteId(TESTING_ID);
- request.setNetworkId("test1");
-
- UpdateNetworkResponse mockResponse = new UpdateNetworkResponse();
- mockResponse.setNetworkId("test1");
- wireMockRule.stubFor(put(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID)).willReturn(aResponse()
- .withHeader("Content-Type", "application/json").withBody(mockResponse.toJsonString()).withStatus(200)));
-
- UpdateNetworkResponse response = client.updateNetwork(AAI_NETWORK_ID, request);
- assertEquals("Testing UpdateVfModule response", "test1", response.getNetworkId());
- }
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/requests/db/RequestsDbAdapterClientTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/requests/db/RequestsDbAdapterClientTest.java
deleted file mode 100644
index 2c35151895..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/requests/db/RequestsDbAdapterClientTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.client.adapter.requests.db;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class RequestsDbAdapterClientTest {
-
- @BeforeClass
- public static void setUp() {
- System.setProperty("mso.config.path", "src/test/resources");
- }
-
- @Test
- public void updateInfraRequestTest()
- {
-
- }
-
- @Test
- public void getInfraRequestTest()
- {
-
- }
-
- @Test
- public void getSiteStatusTest()
- {
-
- }
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/requests/db/entities/MsoRequestsDbExceptionBeanTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/requests/db/entities/MsoRequestsDbExceptionBeanTest.java
deleted file mode 100644
index f0c6e7ec52..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/requests/db/entities/MsoRequestsDbExceptionBeanTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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.
-* ============LICENSE_END=========================================================
-*/
-
-package org.openecomp.mso.client.adapter.requests.db.entities;
-
-import org.junit.Test;
-
-public class MsoRequestsDbExceptionBeanTest {
-
- @Test
- public void test() {
- MsoRequestsDbExceptionBean mrde=new MsoRequestsDbExceptionBean("msg");
- mrde.setMessage("msg");
- assert(mrde.getMessage().equals("msg"));
- }
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/requests/db/entities/MsoRequestsDbExceptionTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/requests/db/entities/MsoRequestsDbExceptionTest.java
deleted file mode 100644
index 28b8cc991f..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/requests/db/entities/MsoRequestsDbExceptionTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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.
-* ============LICENSE_END=========================================================
-*/
-
-package org.openecomp.mso.client.adapter.requests.db.entities;
-
-import org.junit.Test;
-
-public class MsoRequestsDbExceptionTest {
-
- @Test
- public void test() {
- Throwable e = new Throwable();
- MsoRequestsDbExceptionBean mredb=new MsoRequestsDbExceptionBean();
- MsoRequestsDbException mrde=new MsoRequestsDbException("msg",e);
- MsoRequestsDbException mrd=new MsoRequestsDbException("msg");
- MsoRequestsDbException mrd1=new MsoRequestsDbException(e);
- mrde.setFaultInfo(mredb);
- assert(mrde.getFaultInfo().equals(mredb));
- }
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/requests/db/entities/UpdateInfraRequestTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/requests/db/entities/UpdateInfraRequestTest.java
deleted file mode 100644
index d01c11948b..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/requests/db/entities/UpdateInfraRequestTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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.
-* ============LICENSE_END=========================================================
-*/
-
-package org.openecomp.mso.client.adapter.requests.db.entities;
-
-import org.junit.Test;
-
-public class UpdateInfraRequestTest {
-
- @Test
- public void test() {
- UpdateInfraRequest uir=new UpdateInfraRequest();
- RequestStatusType requestStatus=RequestStatusType.COMPLETE;
- uir.setConfigurationId("configurationId");
- uir.setConfigurationName("configurationName");
- uir.setLastModifiedBy("lastModifiedBy");
- uir.setNetworkId("networkId");
- uir.setProgress("progress");
- uir.setRequestId("requestId");
- uir.setRequestStatus(requestStatus);
- uir.setResponseBody("responseBody");
- uir.setServiceInstanceId("serviceInstanceId");
- uir.setServiceInstanceName("serviceInstanceName");
- uir.setStatusMessage("statusMessage");
- uir.setVfModuleId("vfModuleId");
- uir.setVfModuleName("vfModuleName");
- uir.setVnfId("vnfId");
- uir.setVnfOutputs("vnfOutputs");
- uir.setVolumeGroupId("volumeGroupId");
- assert(uir.getConfigurationId().equals("configurationId"));
- assert(uir.getConfigurationName().equals("configurationName"));
- assert(uir.getLastModifiedBy().equals("lastModifiedBy"));
- assert(uir.getNetworkId().equals("networkId"));
- assert(uir.getProgress().equals("progress"));
- assert(uir.getRequestId().equals("requestId"));
- assert(uir.getRequestStatus().equals(requestStatus));
- assert(uir.getResponseBody().equals("responseBody"));
- assert(uir.getServiceInstanceId().equals("serviceInstanceId"));
- assert(uir.getServiceInstanceName().equals("serviceInstanceName"));
- assert(uir.getStatusMessage().equals("statusMessage"));
- assert(uir.getVfModuleId().equals("vfModuleId"));
- assert(uir.getVnfOutputs().equals("vnfOutputs"));
- assert(uir.getVolumeGroupId().equals("volumeGroupId"));
- assert(uir.getVfModuleName().equals("vfModuleName"));
- assert(uir.getVnfId().equals("vnfId"));
- }
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/vnf/VnfAdapterClientTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/vnf/VnfAdapterClientTest.java
deleted file mode 100644
index 21448256ed..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/adapter/vnf/VnfAdapterClientTest.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.client.adapter.vnf;
-
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.equalTo;
-import static com.github.tomakehurst.wiremock.client.WireMock.get;
-import static com.github.tomakehurst.wiremock.client.WireMock.post;
-import static com.github.tomakehurst.wiremock.client.WireMock.put;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
-import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
-import static org.junit.Assert.assertEquals;
-
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
-import org.openecomp.mso.adapters.vnfrest.CreateVfModuleRequest;
-import org.openecomp.mso.adapters.vnfrest.CreateVfModuleResponse;
-import org.openecomp.mso.adapters.vnfrest.DeleteVfModuleRequest;
-import org.openecomp.mso.adapters.vnfrest.DeleteVfModuleResponse;
-import org.openecomp.mso.adapters.vnfrest.QueryVfModuleResponse;
-import org.openecomp.mso.adapters.vnfrest.RollbackVfModuleRequest;
-import org.openecomp.mso.adapters.vnfrest.RollbackVfModuleResponse;
-import org.openecomp.mso.adapters.vnfrest.UpdateVfModuleRequest;
-import org.openecomp.mso.adapters.vnfrest.UpdateVfModuleResponse;
-import org.openecomp.mso.adapters.vnfrest.VfModuleRollback;
-
-import com.github.tomakehurst.wiremock.junit.WireMockRule;
-
-public class VnfAdapterClientTest {
-
- @Rule
- public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().port(28090));
-
- private static final String TESTING_ID = "___TESTING___";
- private static final String AAI_VNF_ID = "test";
- private static final String AAI_VF_MODULE_ID = "test";
- private static final String REST_ENDPOINT = "/vnfs/rest/v1/vnfs";
-
- private VnfAdapterClientImpl client = new VnfAdapterClientImpl();
-
- @BeforeClass
- public static void setUp() {
- System.setProperty("mso.config.path", "src/test/resources");
- }
-
- @Test
- public void createVfModuleTest() {
- CreateVfModuleRequest request = new CreateVfModuleRequest();
- request.setCloudSiteId(TESTING_ID);
-
- CreateVfModuleResponse mockResponse = new CreateVfModuleResponse();
- mockResponse.setVfModuleCreated(true);
- wireMockRule.stubFor(post(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules"))
- .willReturn(aResponse().withHeader("Content-Type", "application/json")
- .withBody(mockResponse.toJsonString()).withStatus(200)));
-
- CreateVfModuleResponse response = client.createVfModule(AAI_VNF_ID, request);
- assertEquals("Testing CreateVfModule response", true, response.getVfModuleCreated());
- }
-
- @Test
- public void rollbackVfModuleTest() {
- RollbackVfModuleRequest request = new RollbackVfModuleRequest();
- VfModuleRollback rollback = new VfModuleRollback();
- rollback.setCloudSiteId(TESTING_ID);
- request.setVfModuleRollback(rollback);
-
- RollbackVfModuleResponse mockResponse = new RollbackVfModuleResponse();
- mockResponse.setVfModuleRolledback(true);
- wireMockRule.stubFor(
- put(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/" + AAI_VF_MODULE_ID + "/rollback"))
- .willReturn(aResponse().withHeader("Content-Type", "application/json")
- .withBody(mockResponse.toJsonString()).withStatus(200)));
-
- RollbackVfModuleResponse response = client.rollbackVfModule(AAI_VNF_ID, AAI_VF_MODULE_ID, request);
- assertEquals("Testing RollbackVfModule response", true, response.getVfModuleRolledback());
- }
-
- @Test
- public void deleteVfModuleTest() {
- DeleteVfModuleRequest request = new DeleteVfModuleRequest();
- request.setCloudSiteId(TESTING_ID);
-
- DeleteVfModuleResponse mockResponse = new DeleteVfModuleResponse();
- mockResponse.setVfModuleDeleted(true);
- wireMockRule.stubFor(put(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/" + AAI_VF_MODULE_ID))
- .willReturn(aResponse().withHeader("Content-Type", "application/json")
- .withBody(mockResponse.toJsonString()).withStatus(200)));
-
- DeleteVfModuleResponse response = client.deleteVfModule(AAI_VNF_ID, AAI_VF_MODULE_ID, request);
- assertEquals("Testing DeleteVfModule response", true, response.getVfModuleDeleted());
- }
-
- @Test
- public void updateVfModuleTest() {
- UpdateVfModuleRequest request = new UpdateVfModuleRequest();
- request.setCloudSiteId(TESTING_ID);
- request.setVfModuleId("test1");
-
- UpdateVfModuleResponse mockResponse = new UpdateVfModuleResponse();
- mockResponse.setVfModuleId("test1");
- wireMockRule.stubFor(put(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/"))
- .willReturn(aResponse().withHeader("Content-Type", "application/json")
- .withBody(mockResponse.toJsonString()).withStatus(200)));
-
- UpdateVfModuleResponse response = client.updateVfModule(AAI_VNF_ID, AAI_VF_MODULE_ID, request);
- assertEquals("Testing UpdateVfModule response", "test1", response.getVfModuleId());
- }
-
- @Test
- public void queryVfModuleTest() {
- QueryVfModuleResponse mockResponse = new QueryVfModuleResponse();
- mockResponse.setVnfId(AAI_VNF_ID);
- mockResponse.setVfModuleId(AAI_VF_MODULE_ID);
- wireMockRule.stubFor(get(urlPathEqualTo(REST_ENDPOINT))
- .withQueryParam("cloudSiteId", equalTo(TESTING_ID))
- .withQueryParam("tenantId", equalTo(TESTING_ID))
- .withQueryParam("vfModuleName", equalTo("someName"))
- .withQueryParam("skipAAI", equalTo("true"))
- .withQueryParam("msoRequest.requestId", equalTo("testRequestId"))
- .withQueryParam("msoRequest.serviceInstanceId", equalTo("serviceInstanceId"))
- .willReturn(aResponse().withHeader("Content-Type", "application/json")
- .withBody(mockResponse.toJsonString()).withStatus(200)));
- QueryVfModuleResponse response = client.queryVfModule(AAI_VNF_ID, AAI_VF_MODULE_ID, TESTING_ID, TESTING_ID,
- "someName", true, "testRequestId", "serviceInstanceId");
- assertEquals("Testing QueryVfModule response", AAI_VF_MODULE_ID, response.getVfModuleId());
- }
-
- @Test
- public void healthCheckTest() {
- wireMockRule.stubFor(get(urlPathEqualTo("/vnfs/rest/v1/vnfs")).willReturn(
- aResponse().withHeader("Content-Type", "text/plain").withBody("healthCheck").withStatus(200)));
-
- String healthCheck = client.healthCheck();
- assertEquals("HealthCheck is correct", "healthCheck", healthCheck);
- }
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerClientTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerClientTest.java
deleted file mode 100644
index 59be8235fe..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerClientTest.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.client.appc;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.util.Properties;
-import java.util.UUID;
-
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.onap.appc.client.lcm.model.Action;
-import org.onap.appc.client.lcm.model.ActionIdentifiers;
-import org.onap.appc.client.lcm.model.CheckLockInput;
-import org.onap.appc.client.lcm.model.Status;
-
-public class ApplicationControllerClientTest {
-
- @BeforeClass
- public static void beforeClass() {
- System.setProperty("mso.config.path", "src/test/resources");
- }
-
- @Test
- public void testClientCreation() {
- ApplicationControllerClient client = new ApplicationControllerClient("appc");
- assertEquals(client.getControllerType(), "APPC");
- assertNotNull(client.getAppCClient());
- }
-
- @Test
- public void createRequest_CheckLock_RequestBuilt() {
- ApplicationControllerClient client = new ApplicationControllerClient("APPC");
- ActionIdentifiers actionIdentifiers = new ActionIdentifiers();
- actionIdentifiers.setVnfId("vnfId");
- CheckLockInput checkLockInput = (CheckLockInput) client.createRequest(Action.CheckLock, actionIdentifiers, null,
- "requestId");
- assertEquals(checkLockInput.getAction().name(), "CheckLock");
- }
-
- @Test
- @Ignore // 1802 merge
- public void runCommand_liveAppc() {
- ApplicationControllerClient client = new ApplicationControllerClient("appc");
- ActionIdentifiers actionIdentifiers = new ActionIdentifiers();
- //actionIdentifiers.setVnfId("ca522254-2ba4-4fbd-b15b-0ef0d9cfda5f");
- actionIdentifiers.setVnfId("2d2bf10e-81a5-");
- Status status;
- try {
- status = client.runCommand(Action.Lock, actionIdentifiers, null, UUID.randomUUID().toString());
- } catch (ApplicationControllerOrchestratorException e) {
- status = new Status();
- status.setCode(e.getAppcCode());
- status.setMessage(e.getMessage());
- }
- assertEquals("Status of run command is correct", status.getCode(), 306);
- }
-
- @Test
- @Ignore // 1802 merge
- public void runCommand_CheckLock_RequestBuilt() {
- ApplicationControllerClient client = new ApplicationControllerClient("appc");
- ActionIdentifiers actionIdentifiers = new ActionIdentifiers();
- actionIdentifiers.setVnfId("fusion-vpp-vnf-001");
- Status status;
- try {
- status = client.runCommand(Action.Unlock, actionIdentifiers, null, "requestId");
- } catch (ApplicationControllerOrchestratorException e) {
- status = new Status();
- status.setCode(e.getAppcCode());
- status.setMessage(e.getMessage());
- }
- assertEquals("Status of run command is correct", status.getCode(), 309);
- }
-
- @Test
- public void test_getLCMPropertiesHelper() {
- ApplicationControllerClient client = new ApplicationControllerClient();
- Properties properties = client.getLCMProperties();
- assertEquals(properties.get("topic.read"), "APPC-TEST-AMDOCS2");
- assertEquals(properties.get("topic.write"), "APPC-TEST-AMDOCS1-DEV3");
- assertEquals(properties.get("SDNC-topic.read"), "SDNC-LCM-READ");
- assertEquals(properties.get("SDNC-topic.write"), "SDNC-LCM-WRITE");
- assertEquals(properties.get("topic.read.timeout"), "120000");
- assertEquals(properties.get("client.response.timeout"), "120000");
- assertEquals(properties.get("poolMembers"),
- "uebsb93kcdc.it.att.com:3904,uebsb92kcdc.it.att.com:3904,uebsb91kcdc.it.att.com:3904");
- assertEquals(properties.get("client.key"), "iaEMAfjsVsZnraBP");
- assertEquals(properties.get("client.secret"), "wcivUjsjXzmGFBfxMmyJu9dz");
- assertEquals(properties.get("controllerType"), "appc");
- }
-
-} \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerOrchestratorTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerOrchestratorTest.java
deleted file mode 100644
index d9c5654989..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerOrchestratorTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.client.appc;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Optional;
-import java.util.UUID;
-
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import org.onap.appc.client.lcm.model.Action;
-import org.onap.appc.client.lcm.model.Status;
-
-public class ApplicationControllerOrchestratorTest {
-
- @BeforeClass
- public static void beforeClass() {
- System.setProperty("mso.config.path", "src/test/resources");
- }
-
- @Test
- @Ignore
- public void vnfCommandTest() {
- ApplicationControllerOrchestrator client = new ApplicationControllerOrchestrator();
- Status status;
- try {
- status = client.vnfCommand(Action.Lock, UUID.randomUUID().toString(),
- "3ffdee3c-94d2-45fe-904d-fc1efa0f8b59", Optional.of(""), "appc");
- } catch (ApplicationControllerOrchestratorException e) {
- status = new Status();
- status.setCode(e.getAppcCode());
- status.setMessage(e.getMessage());
- }
- assertEquals("Status of vnfCommand is correct", status.getCode(), 306);
- }
-
- @Test
- @Ignore
- public void vnfCommandTest1() {
- ApplicationControllerOrchestrator client = new ApplicationControllerOrchestrator();
- Status status;
- try {
- status = client.vnfCommand(Action.Unlock, UUID.randomUUID().toString(),
- "ca522254-2ba4-4fbd-b15b-0ef0d9cfda5f", Optional.of(""), "appc");
- } catch (ApplicationControllerOrchestratorException e) {
- status = new Status();
- status.setCode(e.getAppcCode());
- status.setMessage(e.getMessage());
- }
- assertEquals("Status of vnfCommand is correct", status.getCode(), 306);
- }
-} \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerSupportTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerSupportTest.java
deleted file mode 100644
index d2d4f5002a..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerSupportTest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.client.appc;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.onap.appc.client.lcm.model.Status;
-import org.openecomp.mso.client.appc.ApplicationControllerSupport.StatusCategory;
-
-import junitparams.JUnitParamsRunner;
-import junitparams.Parameters;
-
-@RunWith(JUnitParamsRunner.class)
-public class ApplicationControllerSupportTest {
-
- public static Object[][] statusesAndCategories() {
- return new Object[][]{
- {100, StatusCategory.NORMAL},
- {200, StatusCategory.ERROR},
- {300, StatusCategory.ERROR},
- {400, StatusCategory.NORMAL},
- {401, StatusCategory.ERROR},
- {500, StatusCategory.NORMAL},
- {501, StatusCategory.ERROR},
- {502, StatusCategory.WARNING},
- {800, StatusCategory.WARNING},
- };
- }
-
- public static Object[][] statusesAndFinalities() {
- return new Object[][]{
- {100, false},
- {200, true},
- {300, true},
- {400, true},
- {500, false},
- {800, true},
- };
- }
-
- @Test
- @Parameters(method = "statusesAndCategories")
- public void shouldReturnCategoryForCode(int code, StatusCategory category) throws Exception {
- // when
- StatusCategory detectedCategory = ApplicationControllerSupport.getCategoryOf(createStatus(code));
- // then
- assertThat(detectedCategory).isEqualTo(category);
- }
-
- @Test
- @Parameters(method = "statusesAndFinalities")
- public void shouldReturnFinalityForCode(int code, boolean expectedFinality) throws Exception {
- // when
- boolean finality = ApplicationControllerSupport.getFinalityOf(createStatus(code));
- // then
- assertThat(finality).isEqualTo(expectedFinality);
- }
-
- private Status createStatus(int code) {
- Status status = new Status();
- status.setCode(code);
- return status;
- }
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/policy/CommonObjectMapperProviderTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/policy/CommonObjectMapperProviderTest.java
deleted file mode 100644
index e1b1770180..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/policy/CommonObjectMapperProviderTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.client.policy;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.MapperFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import org.junit.Test;
-
-public class CommonObjectMapperProviderTest {
-
- @Test
- public void shouldSetCorrectMapperProperties() throws Exception {
- // given
- CommonObjectMapperProvider provider = new CommonObjectMapperProvider();
- // when
- ObjectMapper context = provider.getContext(Object.class);
- // then
- assertThat(context.isEnabled(MapperFeature.USE_ANNOTATIONS)).isTrue();
- assertThat(context.isEnabled(SerializationFeature.WRAP_ROOT_VALUE)).isFalse();
- assertThat(context.isEnabled(DeserializationFeature.UNWRAP_ROOT_VALUE)).isFalse();
- }
-} \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/beans/SDNCRequestTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/beans/SDNCRequestTest.java
deleted file mode 100644
index 3fd433d017..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/beans/SDNCRequestTest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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.
-* ============LICENSE_END=========================================================
-*/
-package org.openecomp.mso.client.sdnc.beans;
-
-import static org.junit.Assert.*;
-
-
-
-import org.junit.Test;
-public class SDNCRequestTest {
- private SDNCRequest sdncrequest = new SDNCRequest();
- SDNCSvcAction svcaction = SDNCSvcAction.ACTIVATE;
- SDNCSvcOperation svcoperation = SDNCSvcOperation.VNF_TOPOLOGY_OPERATION;
- @Test
- public void testSDNCRequestTest() {
- sdncrequest.setRequestId("requestId");
- sdncrequest.setSvcInstanceId("svcInstanceId");
- sdncrequest.setSvcAction(svcaction);
- sdncrequest.setSvcOperation(svcoperation);
- sdncrequest.setCallbackUrl("callbackUrl");
- sdncrequest.setMsoAction("msoAction");
- sdncrequest.setRequestData("requestData");
- assertEquals(sdncrequest.getRequestId(), "requestId");
- assertEquals(sdncrequest.getSvcInstanceId(), "svcInstanceId");
- assertEquals(sdncrequest.getSvcAction(), svcaction);
- assertEquals(sdncrequest.getSvcOperation(), svcoperation);
- assertEquals(sdncrequest.getCallbackUrl(), "callbackUrl");
- assertEquals(sdncrequest.getMsoAction(), "msoAction");
- assertEquals(sdncrequest.getRequestData(), "requestData");
- }
- @Test
- public void testToString(){
- assert(sdncrequest.toString()!=null);
- }
-
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/CallbackHeaderTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/CallbackHeaderTest.java
deleted file mode 100644
index 995bb5b19c..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/CallbackHeaderTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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.
-* ============LICENSE_END=========================================================
-*/
-package org.openecomp.mso.client.sdnc.sync;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-public class CallbackHeaderTest {
-
- CallbackHeader cbh = new CallbackHeader();
- CallbackHeader cbh1 = new CallbackHeader("reqId", "respCode", "respMsg");
-
- @Test
- public void testCallbackHeader() {
- cbh.setRequestId("requestId");
- cbh.setResponseCode("responseCode");
- cbh.setResponseMessage("responseMessage");
- assertEquals(cbh.getRequestId(), "requestId");
- assertEquals(cbh.getResponseCode(), "responseCode");
- assertEquals(cbh.getResponseMessage(), "responseMessage");
- assert(cbh.toString()!=null);
- }
-
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/ObjectFactoryTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/ObjectFactoryTest.java
deleted file mode 100644
index 04bc7dc132..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/ObjectFactoryTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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.
-* ============LICENSE_END=========================================================
-*/
-
-package org.openecomp.mso.client.sdnc.sync;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-public class ObjectFactoryTest {
- ObjectFactory of = new ObjectFactory();
-
- @Test
- public void testObjectFactory() {
- of.createRequestHeader();
- of.createSDNCAdapterRequest();
- of.createSDNCAdapterResponse();
-
-
- }
-
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/RequestHeaderTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/RequestHeaderTest.java
deleted file mode 100644
index 1d04572207..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/RequestHeaderTest.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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.
-* ============LICENSE_END=========================================================
-*/
-package org.openecomp.mso.client.sdnc.sync;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-public class RequestHeaderTest {
- RequestHeader rh = new RequestHeader();
-
- @Test
- public void testRequestHeader() {
- rh.setRequestId("requestId");
- rh.setSvcInstanceId("svcInstanceId");
- rh.setSvcAction("svcAction");
- rh.setSvcOperation("svcOperation");
- rh.setCallbackUrl("callbackUrl");
- rh.setMsoAction("msoAction");
- assertEquals(rh.getRequestId(), "requestId");
- assertEquals(rh.getSvcInstanceId(), "svcInstanceId");
- assertEquals(rh.getSvcAction(), "svcAction");
- assertEquals(rh.getSvcOperation(), "svcOperation");
- assertEquals(rh.getCallbackUrl(), "callbackUrl");
- assertEquals(rh.getMsoAction(), "msoAction");
- assert(rh.toString()!=null);
- }
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/RequestTunablesTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/RequestTunablesTest.java
deleted file mode 100644
index 1219f69874..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/RequestTunablesTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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.
-* ============LICENSE_END=========================================================
-*/
-package org.openecomp.mso.client.sdnc.sync;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.mso.properties.MsoPropertiesFactory;
-
-public class RequestTunablesTest {
- MsoPropertiesFactory mpf = new MsoPropertiesFactory();
-
- RequestTunables rt = new RequestTunables("reqId", "msoAction", "operation", "action", mpf);
-
- @Test
- public void testRequestTunables() {
- rt.setReqId("reqId");
- rt.setReqMethod("reqMethod");
- rt.setMsoAction("msoAction");
- rt.setAction("action");
- rt.setOperation("operation");
- rt.setSdncUrl("sdncUrl");
- rt.setTimeout("timeout");
- rt.setAsyncInd("asyncInd");
- rt.setHeaderName("headerName");
- rt.setSdncaNotificationUrl("sdncaNotificationUrl");
- rt.setNamespace("namespace");
- assertEquals(rt.getReqId(), "reqId");
- assertEquals(rt.getReqMethod(), "reqMethod");
- assertEquals(rt.getMsoAction(), "msoAction");
- assertEquals(rt.getAction(), "action");
- assertEquals(rt.getOperation(), "operation");
- assertEquals(rt.getSdncUrl(), "sdncUrl");
- assertEquals(rt.getTimeout(), "timeout");
- assertEquals(rt.getAsyncInd(), "asyncInd");
- assertEquals(rt.getHeaderName(), "headerName");
- assertEquals(rt.getSdncaNotificationUrl(), "sdncaNotificationUrl");
- assertEquals(rt.getNamespace(), "namespace");
- assert(rt.toString()!=null);
- }
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/SDNCAdapterCallbackRequestTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/SDNCAdapterCallbackRequestTest.java
deleted file mode 100644
index 53fbb0a4aa..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/SDNCAdapterCallbackRequestTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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.
-* ============LICENSE_END=========================================================
-*/
-package org.openecomp.mso.client.sdnc.sync;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-public class SDNCAdapterCallbackRequestTest {
-
- SDNCAdapterCallbackRequest sdnccall = new SDNCAdapterCallbackRequest();
- CallbackHeader cbh = new CallbackHeader();
- Object o = new Object();
-
- @Test
- public void testSDNCAdapterCallbackRequest() {
- sdnccall.setCallbackHeader(cbh);
- sdnccall.setRequestData(o);
- assertEquals(sdnccall.getCallbackHeader(), cbh);
- assertEquals(sdnccall.getRequestData(), o);
- assert(sdnccall.toString()!=null);
- }
-
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/SDNCAdapterRequestTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/SDNCAdapterRequestTest.java
deleted file mode 100644
index 6b10f25e70..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/SDNCAdapterRequestTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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.
-* ============LICENSE_END=========================================================
-*/
-package org.openecomp.mso.client.sdnc.sync;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-public class SDNCAdapterRequestTest {
-
- SDNCAdapterRequest adapter = new SDNCAdapterRequest();
- RequestHeader rh = new RequestHeader();
- Object o = new Object();
-
- @Test
- public void testSDNCAdapterRequest() {
- adapter.setRequestHeader(rh);
- adapter.setRequestData(o);
- assertEquals(adapter.getRequestHeader(), rh);
- assertEquals(adapter.getRequestData(), o);
- }
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/SDNCResponseTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/SDNCResponseTest.java
deleted file mode 100644
index d8c23249c4..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sdnc/sync/SDNCResponseTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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.
-* ============LICENSE_END=========================================================
-*/
-package org.openecomp.mso.client.sdnc.sync;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-public class SDNCResponseTest {
-
- SDNCResponse sdnc = new SDNCResponse("reqId");
- SDNCResponse sdnc1 = new SDNCResponse("reqId", 0, "respMsg");
-
- @Test
- public void testSDNCResponse() {
- sdnc.setReqId("reqId");
- sdnc.setRespCode(0);
- sdnc.setRespMsg("respMsg");
- sdnc.setSdncResp("sdncResp");
- assertEquals(sdnc.getReqId(), "reqId");
- assertEquals(sdnc.getRespCode(), 0);
- assertEquals(sdnc.getRespMsg(), "respMsg");
- assertEquals(sdnc.getSdncResp(), "sdncResp");
- assert(sdnc.toString()!= null);
- }
-}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sndc/SDNCOrchTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sndc/SDNCOrchTest.java
deleted file mode 100644
index 724ae4a90d..0000000000
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/sndc/SDNCOrchTest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. 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.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.client.sndc;
-
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.openecomp.mso.bpmn.core.domain.Customer;
-import org.openecomp.mso.bpmn.core.domain.ModelInfo;
-import org.openecomp.mso.bpmn.core.domain.Request;
-import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition;
-import org.openecomp.mso.bpmn.core.domain.ServiceInstance;
-import org.openecomp.mso.bpmn.core.json.JsonDecomposingException;
-import org.openecomp.mso.client.orchestration.SDNCOrchestrator;
-import org.openecomp.mso.client.sdnc.sync.SDNCSyncRpcClient;
-
-public class SDNCOrchTest {
-
- @BeforeClass
- public static void setup() {
- System.setProperty("mso.config.path", "src/test/resources/");
- }
-
- @Ignore // 1802 merge
- @Test
- public void run () throws JsonDecomposingException {
- ServiceDecomposition serviceDecomp = new ServiceDecomposition ("{\"serviceResources\":{}}","123");
-
- ServiceInstance servInst = new ServiceInstance();
- servInst.setInstanceId("RaaTest-1-id");
- servInst.setServiceType("");
- servInst.setInstanceName("some-junk-name");
- servInst.setServiceId("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
-
- ModelInfo model = new ModelInfo();
- model.setModelInvariantUuid("uuid-miu-svc-011-abcdef");
- model.setModelName("SIModelName1");
- model.setModelUuid("");
- model.setModelVersion("2");
-
- Request req = new Request();
- req.setRequestId("RaaCSIRequestId-1");
- req.setSdncRequestId("c0c5e8bf-d5c4-4d81-b2a9-78832c2c789e");
- req.setModelInfo(model);
-
- Customer cust = new Customer();
- cust.setGlobalSubscriberId("MCBH-1610");
- cust.setSubscriptionServiceType("viprsvc");
-
- serviceDecomp.setCustomer(cust);
- serviceDecomp.setRequest(req);
- serviceDecomp.setCallbackURN("http://localhost:28080/mso/SDNCAdapterCallbackService");
- serviceDecomp.setServiceInstance(servInst);
-
- SDNCOrchestrator sdncO = new SDNCOrchestrator();
- sdncO.createServiceInstance(serviceDecomp);
- }
-
- @Test
- public void runValidateSdncResponse () {
- SDNCSyncRpcClient client = new SDNCSyncRpcClient(null, null);
- client.validateSDNCResponse("{\"v1:RequestData\": {\"output\": {\"svc-request-id\": \"0ca5bf8f-c944-4318-810b-6ddfbec13cc5\",\"response-code\": \"200\",\"response-message\": \"a\"}}}");
- }
-}