diff options
author | Rob Daugherty <rd472p@att.com> | 2018-03-29 04:22:52 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-03-29 04:22:52 +0000 |
commit | 001e0dd8fd950e476c5b8cc0f1a44ece6b299273 (patch) | |
tree | 3ac24f8b652a21196b11d8e74d692fd97cd896eb /mso-api-handlers/mso-api-handler-infra/src/test | |
parent | 527b15d23fe447cbf72eb3548038f901bee0fb89 (diff) | |
parent | 76e46d726af8c3221f1e72b65c12be6ca8f59571 (diff) |
Merge "removed unused api-handler code"
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/test')
17 files changed, 0 insertions, 1760 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/NetworkInfoHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/NetworkInfoHandlerTest.java deleted file mode 100644 index 445fab329f..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/NetworkInfoHandlerTest.java +++ /dev/null @@ -1,65 +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.apihandlerinfra; - -import static org.junit.Assert.assertTrue; - -import org.junit.Test; -import org.openecomp.mso.apihandlerinfra.networkbeans.NetworkRequest; -import org.openecomp.mso.requestsdb.InfraRequests; - -public class NetworkInfoHandlerTest { - - NetworkInfoHandler handler = new NetworkInfoHandler(); - - @Test - public void fillVnfRequestTest(){ - NetworkRequest qr = new NetworkRequest(); - InfraRequests ar = new InfraRequests(); - ar.setVnfId("2990102"); - ar.setVnfParams("test"); - handler.fillNetworkRequest(qr, ar, "v3"); - String vnfid = (String)qr.getNetworkParams(); - assertTrue(vnfid.equals("test")); - } - - @Test - public void fillVnfRequestTestV2(){ - NetworkRequest qr = new NetworkRequest(); - InfraRequests ar = new InfraRequests(); - ar.setVnfId("2990102"); - ar.setVnfParams("test"); - handler.fillNetworkRequest(qr, ar, "v2"); - String vnfid = (String)qr.getNetworkParams(); - assertTrue(vnfid.equals("test")); - } - - @Test - public void fillVnfRequestTestV1(){ - NetworkRequest qr = new NetworkRequest(); - InfraRequests ar = new InfraRequests(); - ar.setVnfId("2990102"); - ar.setVnfParams("test"); - handler.fillNetworkRequest(qr, ar, "v1"); - String vnfid = (String)qr.getNetworkParams(); - assertTrue(vnfid.equals("test")); - } -} diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/NetworkRequestHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/NetworkRequestHandlerTest.java deleted file mode 100644 index 2089cf1d32..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/NetworkRequestHandlerTest.java +++ /dev/null @@ -1,333 +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.apihandlerinfra; - -import static org.junit.Assert.assertTrue; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.lang.reflect.Field; -import java.net.URI; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.List; - -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; - -import mockit.Expectations; -import mockit.Mock; -import mockit.MockUp; - -import mockit.Mocked; -import org.apache.http.HttpResponse; -import org.apache.http.ProtocolVersion; -import org.apache.http.client.ClientProtocolException; -import org.apache.http.entity.BasicHttpEntity; -import org.apache.http.message.BasicHttpResponse; -import org.hibernate.Session; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.mockito.Mockito; - -import org.openecomp.mso.apihandler.common.CamundaClient; -import org.openecomp.mso.apihandlerinfra.networkbeans.NetworkRequest; -import org.openecomp.mso.db.AbstractSessionFactoryManager; -import org.openecomp.mso.db.catalog.CatalogDatabase; -import org.openecomp.mso.db.catalog.beans.NetworkRecipe; -import org.openecomp.mso.db.catalog.beans.VfModule; -import org.openecomp.mso.db.catalog.beans.VnfResource; -import org.openecomp.mso.properties.MsoPropertiesFactory; -import org.openecomp.mso.requestsdb.InfraActiveRequests; -import org.openecomp.mso.requestsdb.InfraRequests; -import org.openecomp.mso.requestsdb.RequestsDatabase; - -public class NetworkRequestHandlerTest { - private static final String REQ_XML = "<network-request xmlns=\"http://org.openecomp/mso/infra/network-request/v1\"> <request-info> <request-id>e1fc3ed3-31e5-48a8-913b-23184c1e9443</request-id><action>CREATE</action> <source>VID</source> <service-instance-id>e1fc3ed3-31e5-48a8-913b-23184c1e9443</service-instance-id></request-info> <network-inputs> <network-id>e1fc3ed3-31e5-48a8-913b-23184c1e9443</network-id> <network-name>nwInstanceName</network-name> <network-type>nwModelName</network-type><modelCustomizationId>e1fc3ed3-31e5-48a8-913b-23184c1e9443</modelCustomizationId> <aic-cloud-region>e1fc3ed3-31e5-48a8-913b-23184c1e9443</aic-cloud-region> <tenant-id>e1fc3ed3-31e5-48a8-913b-23184c1e9443</tenant-id><service-id>e1fc3ed3-31e5-48a8-913b-23184c1e9443</service-id> <backout-on-failure>false</backout-on-failure><sdncVersion>1802</sdncVersion><service-instance-id>e1fc3ed3-31e5-48a8-913b-23184c1e9443</service-instance-id></network-inputs> <network-params></network-params> </network-request>"; - - private static MockUp<RequestsDatabase> mockRDB; - private static MockUp<CatalogDatabase> mockCDB; - private static MockUp<CamundaClient> mockCamundaClient; - - NetworkRequestHandler handler = null; - UriInfo uriInfo = null; - - @Before - public void setup() throws Exception{ - - uriInfo = Mockito.mock(UriInfo.class); - - Class<?> clazz = NetworkRequestHandler.class; - handler = (NetworkRequestHandler)clazz.newInstance(); - - Field f1 = handler.getClass().getDeclaredField("uriInfo"); - - f1.setAccessible(true); - f1.set(handler, uriInfo); - - } - - @BeforeClass - public static void setUp() throws Exception { - MsoPropertiesFactory msoPropertiesFactory = new MsoPropertiesFactory(); - msoPropertiesFactory.removeAllMsoProperties(); - msoPropertiesFactory.initializeMsoProperties(Constants.MSO_PROP_APIHANDLER_INFRA, "src/test/resources/mso.apihandler-infra.properties"); - - mockRDB = new MockUp<RequestsDatabase>() { - @Mock - public InfraActiveRequests checkDuplicateByVnfName (String vnfName, String action, String requestType) { - return null; - } - @Mock - public int updateInfraStatus (String requestId, String requestStatus, long progress, String lastModifiedBy) { - return 1; - } - - @Mock - public int updateInfraFinalStatus (String requestId, String requestStatus, String statusMessage, long progress, String responseBody, String lastModifiedBy) { - return 1; - } - }; - - mockCDB = new MockUp<CatalogDatabase>() { - @Mock - public NetworkRecipe getNetworkRecipe (String networkType, String action, String serviceType) { - final NetworkRecipe networkRecipe = new NetworkRecipe(); - networkRecipe.setOrchestrationUri("test/vnf"); - networkRecipe.setRecipeTimeout(180); - return networkRecipe; - } - - @Mock - public VfModule getVfModuleType(String type, String version) { - final VfModule vfModule = new VfModule(); - return vfModule; - } - - @Mock - public VnfResource getVnfResource (String vnfType, String serviceVersion) { - final VnfResource vnfResource = new VnfResource(); - return vnfResource; - } - }; - - mockCamundaClient = new MockUp<CamundaClient>() { - @Mock - public HttpResponse post(String camundaReqXML, String requestId, - String requestTimeout, String schemaVersion, String serviceInstanceId, String action) - throws ClientProtocolException, IOException { - ProtocolVersion pv = new ProtocolVersion("HTTP",1,1); - HttpResponse resp = new BasicHttpResponse(pv,200, "test response"); - BasicHttpEntity entity = new BasicHttpEntity(); - String body = "{\"response\":\"success\",\"message\":\"success\"}"; - InputStream instream = new ByteArrayInputStream(body.getBytes()); - entity.setContent(instream); - resp.setEntity(entity); - return resp; - } - }; - - } - - @AfterClass - public static void tearDown() { - mockRDB.tearDown(); - mockCDB.tearDown(); - mockCamundaClient.tearDown(); - } - - @Test - public void manageVnfRequestTest(@Mocked AbstractSessionFactoryManager sessionFactoryManager, - @Mocked Session session){ - new Expectations() {{ - sessionFactoryManager.getSessionFactory().openSession(); result = session; - }}; - Mockito.when(uriInfo.getRequestUri()).thenReturn(URI.create("http://localhost:8080/test")); - Response resp = handler.manageNetworkRequest(REQ_XML, "v2"); - assertTrue(null != resp); - } - - @Test - public void manageVnfRequestTestV1(@Mocked AbstractSessionFactoryManager sessionFactoryManager, - @Mocked Session session){ - new Expectations() {{ - sessionFactoryManager.getSessionFactory().openSession(); result = session; - }}; - Mockito.when(uriInfo.getRequestUri()).thenReturn(URI.create("http://localhost:8080/test")); - Response resp = handler.manageNetworkRequest(REQ_XML, "v1"); - assertTrue(null != resp); - } - - @Test - public void manageVnfRequestTestV3(@Mocked AbstractSessionFactoryManager sessionFactoryManager, - @Mocked Session session){ - new Expectations() {{ - sessionFactoryManager.getSessionFactory().openSession(); result = session; - }}; - Mockito.when(uriInfo.getRequestUri()).thenReturn(URI.create("http://localhost:8080/test")); - Response resp = handler.manageNetworkRequest(REQ_XML, "v3"); - assertTrue(null != resp); - } - - @Test - public void manageVnfRequestTestInvalidVersion(){ - Response resp = handler.manageNetworkRequest(REQ_XML, "v249"); - assertTrue(null != resp); - } - - @Test - public void manageVnfRequest2Test(){ - Mockito.when(uriInfo.getRequestUri()) - .thenReturn(URI.create("http://localhost:8080/test")); - - new MockUp<MsoPropertiesUtils>() { - @Mock - public synchronized final boolean getNoPropertiesState() { - return false; - } - }; - Response resp = handler.manageNetworkRequest(REQ_XML, "v2"); - assertTrue(null != resp); - } - - @Test - public void fillNetworkRequestTestV1(){ - NetworkRequest qr = new NetworkRequest(); - InfraRequests ar = new InfraRequests(); - ar.setVnfId("1003"); - ar.setVnfName("vnf"); - ar.setVnfType("vnt"); - ar.setTenantId("48889690"); - ar.setProvStatus("uuu"); - ar.setVolumeGroupName("volume"); - ar.setVolumeGroupId("38838"); - ar.setServiceType("vnf"); - ar.setAicNodeClli("djerfe"); - ar.setAaiServiceId("599499"); - ar.setAicCloudRegion("south"); - ar.setVfModuleName("m1"); - ar.setVfModuleId("39949"); - ar.setVfModuleModelName("test"); - ar.setAaiServiceId("37728"); - ar.setVnfParams("test"); - handler.fillNetworkRequest(qr, ar, "v1"); - String param = (String)qr.getNetworkParams(); - assertTrue(param.equals("test")); - } - @Test - public void fillNetworkRequestTestV2(){ - NetworkRequest qr = new NetworkRequest(); - InfraRequests ar = new InfraRequests(); - ar.setVnfId("1003"); - ar.setVnfName("vnf"); - ar.setVnfType("vnt"); - ar.setTenantId("48889690"); - ar.setProvStatus("uuu"); - ar.setVolumeGroupName("volume"); - ar.setVolumeGroupId("38838"); - ar.setServiceType("vnf"); - ar.setAicNodeClli("djerfe"); - ar.setAaiServiceId("599499"); - ar.setAicCloudRegion("south"); - ar.setVfModuleName("m1"); - ar.setVfModuleId("39949"); - ar.setVfModuleModelName("test"); - ar.setAaiServiceId("37728"); - ar.setVnfParams("test"); - handler.fillNetworkRequest(qr, ar, "v2"); - String param = (String)qr.getNetworkParams(); - assertTrue(param.equals("test")); - } - @Test - public void fillNetworkRequestTestV3(){ - NetworkRequest qr = new NetworkRequest(); - InfraRequests ar = new InfraRequests(); - ar.setVnfId("1003"); - ar.setVnfName("vnf"); - ar.setVnfType("vnt"); - ar.setTenantId("48889690"); - ar.setProvStatus("uuu"); - ar.setVolumeGroupName("volume"); - ar.setVolumeGroupId("38838"); - ar.setServiceType("vnf"); - ar.setAicNodeClli("djerfe"); - ar.setAaiServiceId("599499"); - ar.setAicCloudRegion("south"); - ar.setVfModuleName("m1"); - ar.setVfModuleId("39949"); - ar.setVfModuleModelName("test"); - ar.setAaiServiceId("37728"); - ar.setVnfParams("test"); - handler.fillNetworkRequest(qr, ar, "v3"); - String param = (String)qr.getNetworkParams(); - assertTrue(param.equals("test")); - } - - @Test - public void queryFiltersTest(){ - new MockUp<RequestsDatabase>() { - @Mock - public List <InfraActiveRequests> getRequestListFromInfraActive (String queryAttributeName, - String queryValue, - String requestType) { - List <InfraActiveRequests> list = new ArrayList<>(); - InfraActiveRequests req = new InfraActiveRequests(); - req.setAaiServiceId("299392"); - req.setAction("CREATE"); - req.setRequestStatus("COMPLETE"); - req.setProgress(10001L); - req.setSource("test"); - req.setStartTime(new Timestamp(10020100)); - req.setEndTime(new Timestamp(20020100)); - req.setStatusMessage("message"); - list.add(req); - return list; - } - }; - Response resp = handler.queryFilters("networkType", "serviceType", "aicNodeClli", "tenantId", "v1"); - assertTrue(resp.getEntity().toString() != null); - } - - @Test - public void getRequestTest(){ - new MockUp<RequestsDatabase>() { - @Mock - public InfraActiveRequests getRequestFromInfraActive (String requestId, String requestType) { - InfraActiveRequests req = new InfraActiveRequests(); - req.setAaiServiceId("299392"); - req.setAction("CREATE"); - req.setRequestStatus("COMPLETE"); - req.setProgress(10001L); - req.setSource("test"); - req.setStartTime(new Timestamp(10020100)); - req.setEndTime(new Timestamp(20020100)); - req.setStatusMessage("message"); - return req; - } - }; - Response resp = handler.getRequest("388293", "v1"); - assertTrue(resp.getEntity().toString() != null); - } - -} diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/NetworkTypesHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/NetworkTypesHandlerTest.java deleted file mode 100644 index 3738e2f94a..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/NetworkTypesHandlerTest.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.apihandlerinfra; - -import static org.junit.Assert.assertTrue; - -import java.util.ArrayList; -import java.util.List; - -import javax.ws.rs.core.Response; - -import mockit.Mock; -import mockit.MockUp; - -import org.junit.Test; -import org.openecomp.mso.db.catalog.CatalogDatabase; -import org.openecomp.mso.db.catalog.beans.NetworkResource; - -public class NetworkTypesHandlerTest { - - NetworkTypesHandler handler = new NetworkTypesHandler(); - - @Test - public void getNetworkTypesTest(){ - Response resp = handler.getNetworkTypes("v2"); - assertTrue(resp.getEntity().toString() != null); - } - - @Test - public void getNetworkTypesTest2(){ - new MockUp<CatalogDatabase>() { - @Mock - public List <NetworkResource> getAllNetworkResources(){ - return null; - } - }; - Response resp = handler.getNetworkTypes("v2"); - assertTrue(resp.getEntity().toString() != null); - } - - @Test - public void getNetworkTypesTest3(){ - List <NetworkResource> netList = new ArrayList<>(); - new MockUp<CatalogDatabase>() { - @Mock - public List <NetworkResource> getAllNetworkResources(){ - NetworkResource ns = new NetworkResource(); - netList.add(ns); - return netList; - } - }; - Response resp = handler.getNetworkTypes("v2"); - assertTrue(resp.getEntity().toString() != null); - } -} diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VfModuleModelNamesHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VfModuleModelNamesHandlerTest.java deleted file mode 100644 index 1c3c85653b..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VfModuleModelNamesHandlerTest.java +++ /dev/null @@ -1,74 +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.apihandlerinfra; - -import static org.junit.Assert.assertTrue; - -import java.util.ArrayList; -import java.util.List; - -import mockit.Mock; -import mockit.MockUp; - -import org.junit.Test; -import org.openecomp.mso.db.catalog.CatalogDatabase; -import org.openecomp.mso.db.catalog.beans.VfModule; -import org.openecomp.mso.db.catalog.beans.VnfResource; - -import javax.ws.rs.core.Response; -public class VfModuleModelNamesHandlerTest { - - VfModuleModelNamesHandler handler = new VfModuleModelNamesHandler(); - - @Test - public void getVfModuleModelNamesTest(){ - Response resp = handler.getVfModuleModelNames("v2"); - assertTrue(resp.getEntity().toString()!= null); - } - - @Test - public void getVfModuleModelNamesTest2(){ - new MockUp<CatalogDatabase>() { - @Mock - public List <VfModule> getAllVfModules(){ - List <VfModule> list = new ArrayList<>(); - VfModule resource = new VfModule(); - list.add(resource); - return list; - } - }; - Response resp = handler.getVfModuleModelNames("v2"); - assertTrue(resp.getEntity().toString()!= null); - } - - - @Test - public void getVfModuleModelNamesTest3(){ - new MockUp<CatalogDatabase>() { - @Mock - public List <VfModule> getAllVfModules(){ - return null; - } - }; - Response resp = handler.getVfModuleModelNames("v2"); - assertTrue(resp.getEntity().toString()!= null); - } -} diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfInfoHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfInfoHandlerTest.java deleted file mode 100644 index fd22af012f..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfInfoHandlerTest.java +++ /dev/null @@ -1,54 +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.apihandlerinfra; - -import static org.junit.Assert.assertTrue; - -import org.junit.Test; -import org.openecomp.mso.apihandlerinfra.vnfbeans.VnfRequest; -import org.openecomp.mso.requestsdb.InfraRequests; - -public class VnfInfoHandlerTest { - - VnfInfoHandler handler = new VnfInfoHandler(); - - @Test - public void fillVnfRequestTest(){ - VnfRequest qr = new VnfRequest(); - InfraRequests ar = new InfraRequests(); - ar.setVnfId("2990102"); - ar.setVnfParams("test"); - handler.fillVnfRequest(qr, ar, "v3"); - String vnfid = (String)qr.getVnfParams(); - assertTrue(vnfid.equals("test")); - } - - @Test - public void fillVnfRequestTestV2(){ - VnfRequest qr = new VnfRequest(); - InfraRequests ar = new InfraRequests(); - ar.setVnfId("2990102"); - ar.setVnfParams("test"); - handler.fillVnfRequest(qr, ar, "v2"); - String vnfid = (String)qr.getVnfParams(); - assertTrue(vnfid.equals("test")); - } -} diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfMsoInfraRequestTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfMsoInfraRequestTest.java deleted file mode 100644 index 9a9dec3c27..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfMsoInfraRequestTest.java +++ /dev/null @@ -1,59 +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.apihandlerinfra; - -import mockit.Expectations; -import mockit.Mocked; -import mockit.Tested; -import mockit.integration.junit4.JMockit; -import org.hibernate.Session; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.openecomp.mso.apihandler.common.ValidationException; -import org.openecomp.mso.db.AbstractSessionFactoryManager; -import org.openecomp.mso.properties.MsoJavaProperties; - -@RunWith(JMockit.class) -public class VnfMsoInfraRequestTest { - - VnfMsoInfraRequest request = new VnfMsoInfraRequest("29919020"); - private String reqXML = "<vnf-request xmlns=\"http://org.openecomp/mso/infra/vnf-request/v1\"><request-info><request-id>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</request-id><action>CREATE_VF_MODULE</action><source>VID</source><!-- new 1610 field --><service-instance-id>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</service-instance-id></request-info><vnf-inputs><!-- not in use in 1610 --><vnf-name>vnfName</vnf-name><vnf-type>vnfType</vnf-type><vnf-id>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</vnf-id><volume-group-id>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</volume-group-id><vf-module-id>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</vf-module-id><vf-module-name>vfModuleName</vf-module-name><vf-module-model-name>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</vf-module-model-name><model-customization-id>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</model-customization-id><asdc-service-model-version>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</asdc-service-model-version><aic-cloud-region>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</aic-cloud-region><tenant-id>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</tenant-id><service-id>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</service-id><backout-on-failure>false</backout-on-failure><service-instance-id>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</service-instance-id></vnf-inputs><vnf-params><vnf-parameter-name>pName</vnf-parameter-name><vnf-parameter-value>pValue</vnf-parameter-value></vnf-params></vnf-request>"; - - @Test - public void parseTest() throws ValidationException { - request.parse(reqXML, "v3", new MsoJavaProperties()); - } - - @Test - public void createRequestRecord(@Mocked AbstractSessionFactoryManager sessionFactoryManager, - @Mocked Session session) throws ValidationException { - - new Expectations() {{ - sessionFactoryManager.getSessionFactory().openSession(); result = session; - }}; - - request.parse(reqXML, "v3", new MsoJavaProperties()); - request.createRequestRecord(Status.COMPLETE); - - } - -} diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfRequestHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfRequestHandlerTest.java deleted file mode 100644 index 11c385ced9..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfRequestHandlerTest.java +++ /dev/null @@ -1,364 +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.apihandlerinfra; - -import static org.junit.Assert.assertTrue; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.lang.reflect.Field; -import java.net.URI; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.List; - -import mockit.Mock; -import mockit.MockUp; - -import org.apache.http.HttpResponse; -import org.apache.http.ProtocolVersion; -import org.apache.http.StatusLine; -import org.apache.http.client.ClientProtocolException; -import org.apache.http.entity.BasicHttpEntity; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.message.BasicHttpResponse; -import org.apache.http.message.BasicStatusLine; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.mockito.Mockito; -import org.openecomp.mso.apihandler.common.CamundaClient; -import org.openecomp.mso.apihandler.common.RequestClient; -import org.openecomp.mso.apihandler.common.RequestClientFactory; -import org.openecomp.mso.apihandlerinfra.vnfbeans.VnfRequest; -import org.openecomp.mso.db.catalog.CatalogDatabase; -import org.openecomp.mso.db.catalog.beans.VfModule; -import org.openecomp.mso.db.catalog.beans.VnfRecipe; -import org.openecomp.mso.db.catalog.beans.VnfResource; -import org.openecomp.mso.properties.MsoJavaProperties; -import org.openecomp.mso.properties.MsoPropertiesFactory; -import org.openecomp.mso.requestsdb.InfraActiveRequests; -import org.openecomp.mso.requestsdb.InfraRequests; -import org.openecomp.mso.requestsdb.RequestsDatabase; - -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; - -public class VnfRequestHandlerTest { - private static MockUp<RequestsDatabase> mockRDB; - private static MockUp<VnfMsoInfraRequest> mockMsoRequest; - private static MockUp<CatalogDatabase> mockCDB; - private static MockUp<CamundaClient> mockCamudaClient; -// private static MockUp<RequestClientFactory> mockCamudaClient; - VnfRequestHandler handler = null; - UriInfo uriInfo = null; - - private static final String manageVnfRequest = "<vnf-request xmlns=\"http://org.openecomp/mso/infra/vnf-request/v1\"><request-info><request-id>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</request-id><action>CREATE_VF_MODULE</action><source>VID</source><!-- new 1610 field --><service-instance-id>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</service-instance-id></request-info><vnf-inputs><!-- not in use in 1610 --><vnf-name>vnfName</vnf-name><vnf-type>vnfType</vnf-type><vnf-id>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</vnf-id><volume-group-id>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</volume-group-id><vf-module-id>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</vf-module-id><vf-module-name>vfModuleName</vf-module-name><vf-module-model-name>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</vf-module-model-name><model-customization-id>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</model-customization-id><asdc-service-model-version>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</asdc-service-model-version><aic-cloud-region>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</aic-cloud-region><tenant-id>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</tenant-id><service-id>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</service-id><backout-on-failure>false</backout-on-failure><service-instance-id>43b34d6d-1ab2-4c7a-a3a0-5471306550c5</service-instance-id></vnf-inputs><vnf-params>\t\t\t\t</vnf-params></vnf-request>"; - - @Before - public void setup() throws Exception{ - - uriInfo = Mockito.mock(UriInfo.class); - Class<?> clazz = VnfRequestHandler.class; - handler = (VnfRequestHandler)clazz.newInstance(); - - Field f1 = handler.getClass().getDeclaredField("uriInfo"); - - f1.setAccessible(true); - f1.set(handler, uriInfo); - } - - @BeforeClass - public static void setUp() throws Exception { - MsoPropertiesFactory msoPropertiesFactory = new MsoPropertiesFactory(); - msoPropertiesFactory.removeAllMsoProperties(); - msoPropertiesFactory.initializeMsoProperties(Constants.MSO_PROP_APIHANDLER_INFRA, "src/test/resources/mso.apihandler-infra.properties"); - - mockRDB = new MockUp<RequestsDatabase>() { - @Mock - public InfraActiveRequests checkDuplicateByVnfId(String vnfId, String action, String requestType) { - return null; - } - @Mock - public int updateInfraStatus (String requestId, String requestStatus, long progress, String lastModifiedBy) { - return 1; - } - - @Mock - public int updateInfraFinalStatus (String requestId, String requestStatus, String statusMessage, long progress, String responseBody, String lastModifiedBy) { - return 1; - } - }; - - mockMsoRequest = new MockUp<VnfMsoInfraRequest>() { - @Mock - public void createRequestRecord (Status status) { - return; - } - }; - - mockCDB = new MockUp<CatalogDatabase>() { - @Mock - public VnfRecipe getVfModuleRecipe(String vnfType, String vfModuleModelName, String action) { - final VnfRecipe vnfRecipe = new VnfRecipe(); - vnfRecipe.setOrchestrationUri("test/vnf"); - vnfRecipe.setRecipeTimeout(180); - return vnfRecipe; - } - - @Mock - public VfModule getVfModuleType(String type, String version) { - final VfModule vfModule = new VfModule(); - return vfModule; - } - - @Mock - public VnfResource getVnfResource (String vnfType, String serviceVersion) { - final VnfResource vnfResource = new VnfResource(); - return vnfResource; - } - }; - - mockCamudaClient = new MockUp<CamundaClient>() { - @Mock - public HttpResponse post(String camundaReqXML, String requestId, - String requestTimeout, String schemaVersion, String serviceInstanceId, String action) - throws ClientProtocolException, IOException { - ProtocolVersion pv = new ProtocolVersion("HTTP",1,1); - HttpResponse resp = new BasicHttpResponse(pv,200, "test response"); - BasicHttpEntity entity = new BasicHttpEntity(); - String body = "{\"response\":\"success\",\"message\":\"success\"}"; - InputStream instream = new ByteArrayInputStream(body.getBytes()); - entity.setContent(instream); - resp.setEntity(entity); - return resp; - } - }; - - /*mockCamudaClient = new MockUp<RequestClientFactory>() { - @Mock - public RequestClient getRequestClient(String orchestrationURI, MsoJavaProperties props) throws IllegalStateException{ - RequestClient client = new CamundaClient(); - client.setUrl("/test/url"); - return client; - } - };*/ - - } - - @AfterClass - public static void tearDown() { - mockRDB.tearDown(); - mockMsoRequest.tearDown(); - mockCDB.tearDown(); - mockCamudaClient.tearDown(); - } - - @Test - public void manageVnfRequestTestV2(){ - Mockito.when(uriInfo.getRequestUri()).thenReturn(URI.create("http://localhost:8080/test")); - Response resp = handler.manageVnfRequest(manageVnfRequest, "v2"); - assertTrue(null != resp); - } - - @Test - public void manageVnfRequestTestv1(){ - Mockito.when(uriInfo.getRequestUri()).thenReturn(URI.create("http://localhost:8080/test")); - Response resp = handler.manageVnfRequest(manageVnfRequest, "v1"); - assertTrue(null != resp); - } - - @Test - public void manageVnfRequestTestv3(){ - Mockito.when(uriInfo.getRequestUri()).thenReturn(URI.create("http://localhost:8080/test")); - Response resp = handler.manageVnfRequest(manageVnfRequest, "v3"); - assertTrue(null != resp); - } - @Test - public void manageVnfRequestTestInvalidVersion(){ - Response resp = handler.manageVnfRequest(manageVnfRequest, "v30"); - assertTrue(null != resp); - } - - @Test - public void manageVnfRequest2Test(){ - Mockito.when(uriInfo.getRequestUri()) - .thenReturn(URI.create("http://localhost:8080/test")); - - new MockUp<MsoPropertiesUtils>() { - @Mock - public synchronized final boolean getNoPropertiesState() { - return false; - } - }; - Response resp = handler.manageVnfRequest(manageVnfRequest, "v2"); - assertTrue(null != resp); - } - - @Test - public void fillVnfRequestTest(){ - VnfRequest qr = new VnfRequest(); - InfraRequests ar = new InfraRequests(); - ar.setVnfId("1003"); - ar.setVnfName("vnf"); - ar.setVnfType("vnt"); - ar.setTenantId("48889690"); - ar.setProvStatus("uuu"); - ar.setVolumeGroupName("volume"); - ar.setVolumeGroupId("38838"); - ar.setServiceType("vnf"); - ar.setAicNodeClli("djerfe"); - ar.setAaiServiceId("599499"); - ar.setAicCloudRegion("south"); - ar.setVfModuleName("m1"); - ar.setVfModuleId("39949"); - ar.setVfModuleModelName("test"); - ar.setAaiServiceId("37728"); - ar.setVnfParams("test"); - handler.fillVnfRequest(qr, ar, "v1"); - String param = (String)qr.getVnfParams(); - assertTrue(param.equals("test")); - } - - @Test - public void fillVnfRequestTestV2(){ - VnfRequest qr = new VnfRequest(); - InfraRequests ar = new InfraRequests(); - ar.setVnfId("1003"); - ar.setVnfName("vnf"); - ar.setVnfType("vnt"); - ar.setTenantId("48889690"); - ar.setProvStatus("uuu"); - ar.setVolumeGroupName("volume"); - ar.setVolumeGroupId("38838"); - ar.setServiceType("vnf"); - ar.setAicNodeClli("djerfe"); - ar.setAaiServiceId("599499"); - ar.setAicCloudRegion("south"); - ar.setVfModuleName("m1"); - ar.setVfModuleId("39949"); - ar.setVfModuleModelName("test"); - ar.setAaiServiceId("37728"); - ar.setVnfParams("test"); - handler.fillVnfRequest(qr, ar, "v2"); - String param = (String)qr.getVnfParams(); - assertTrue(param.equals("test")); - } - @Test - public void fillVnfRequestTestV3(){ - VnfRequest qr = new VnfRequest(); - InfraRequests ar = new InfraRequests(); - ar.setVnfId("1003"); - ar.setVnfName("vnf"); - ar.setVnfType("vnt"); - ar.setTenantId("48889690"); - ar.setProvStatus("uuu"); - ar.setVolumeGroupName("volume"); - ar.setVolumeGroupId("38838"); - ar.setServiceType("vnf"); - ar.setAicNodeClli("djerfe"); - ar.setAaiServiceId("599499"); - ar.setAicCloudRegion("south"); - ar.setVfModuleName("m1"); - ar.setVfModuleId("39949"); - ar.setVfModuleModelName("test"); - ar.setAaiServiceId("37728"); - ar.setVnfParams("test"); - ar.setServiceInstanceId("38829"); - handler.fillVnfRequest(qr, ar, "v3"); - String param = (String)qr.getVnfParams(); - assertTrue(param.equals("test")); - } - - @Test - public void queryFiltersTest(){ - new MockUp<RequestsDatabase>() { - @Mock - public List <InfraActiveRequests> getRequestListFromInfraActive (String queryAttributeName, - String queryValue, - String requestType) { - List <InfraActiveRequests> list = new ArrayList<>(); - InfraActiveRequests req = new InfraActiveRequests(); - req.setAaiServiceId("299392"); - req.setAction("CREATE"); - req.setRequestStatus("COMPLETE"); - req.setProgress(10001L); - req.setSource("test"); - req.setStartTime(new Timestamp(10020100)); - req.setEndTime(new Timestamp(20020100)); - req.setStatusMessage("message"); - list.add(req); - return list; - } - }; - Response resp = handler.queryFilters("vnfType", "serviceType", "aicNodeClli", "tenantId", "volumeGroupId", "volumeGroupName", "vnfName", "v1"); - assertTrue(resp.getEntity().toString() != null); - } - - @Test - public void queryFiltersTestNullVnfType(){ - new MockUp<RequestsDatabase>() { - @Mock - public List <InfraActiveRequests> getRequestListFromInfraActive (String queryAttributeName, - String queryValue, - String requestType) { - List <InfraActiveRequests> list = new ArrayList<>(); - InfraActiveRequests req = new InfraActiveRequests(); - req.setAaiServiceId("299392"); - req.setAction("CREATE"); - req.setRequestStatus("COMPLETE"); - req.setProgress(10001L); - req.setSource("test"); - req.setStartTime(new Timestamp(10020100)); - req.setEndTime(new Timestamp(20020100)); - req.setStatusMessage("message"); - list.add(req); - return list; - } - }; - Response resp = handler.queryFilters(null, null, null, null, null, null, null, "v1"); - assertTrue(resp.getEntity().toString() != null); - } - - @Test - public void getRequestTest(){ - new MockUp<RequestsDatabase>() { - @Mock - public InfraActiveRequests getRequestFromInfraActive (String requestId, String requestType) { - InfraActiveRequests req = new InfraActiveRequests(); - req.setAaiServiceId("299392"); - req.setAction("CREATE"); - req.setRequestStatus("COMPLETE"); - req.setProgress(10001L); - req.setSource("test"); - req.setStartTime(new Timestamp(10020100)); - req.setEndTime(new Timestamp(20020100)); - req.setStatusMessage("message"); - return req; - } - }; - Response resp = handler.getRequest("388293", "v1"); - assertTrue(resp.getEntity().toString() != null); - } - -} diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfTypesHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfTypesHandlerTest.java deleted file mode 100644 index 1800bb4695..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VnfTypesHandlerTest.java +++ /dev/null @@ -1,75 +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.apihandlerinfra; - -import static org.junit.Assert.assertTrue; - -import java.util.ArrayList; -import java.util.List; - -import mockit.Mock; -import mockit.MockUp; - -import org.junit.Test; -import org.openecomp.mso.db.catalog.CatalogDatabase; -import org.openecomp.mso.db.catalog.beans.NetworkResource; -import org.openecomp.mso.db.catalog.beans.VnfResource; - -import javax.ws.rs.core.Response; - -public class VnfTypesHandlerTest { - - VnfTypesHandler handler = new VnfTypesHandler(); - - @Test - public void getVnfTypesTest(){ - Response resp = handler.getVnfTypes(null, "v2"); - assertTrue(resp.getEntity().toString() != null); - } - - @Test - public void getVnfTypesTest2(){ - new MockUp<CatalogDatabase>() { - @Mock - public List <VnfResource> getAllVnfResources(){ - return null; - } - }; - Response resp = handler.getVnfTypes(null, "v2"); - assertTrue(resp.getEntity().toString() != null); - } - - @Test - public void getVnfTypesTest3(){ - new MockUp<CatalogDatabase>() { - @Mock - public List <VnfResource> getAllVnfResources(){ - List <VnfResource> list = new ArrayList<>(); - VnfResource resource = new VnfResource(); - list.add(resource); - return list; - } - }; - Response resp = handler.getVnfTypes(null, "v2"); - assertTrue(resp.getEntity().toString() != null); - } - -} diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VolumeInfoHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VolumeInfoHandlerTest.java deleted file mode 100644 index ffdf5d40b4..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VolumeInfoHandlerTest.java +++ /dev/null @@ -1,135 +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.apihandlerinfra; - -import static org.junit.Assert.assertTrue; - -import mockit.Mock; -import mockit.MockUp; -import org.apache.http.HttpResponse; -import org.apache.http.ProtocolVersion; -import org.apache.http.client.ClientProtocolException; -import org.apache.http.entity.BasicHttpEntity; -import org.apache.http.message.BasicHttpResponse; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import org.openecomp.mso.apihandler.common.CamundaClient; -import org.openecomp.mso.apihandlerinfra.volumebeans.ActionType; -import org.openecomp.mso.apihandlerinfra.volumebeans.RequestStatusType; -import org.openecomp.mso.apihandlerinfra.volumebeans.VolumeRequest; -import org.openecomp.mso.db.catalog.CatalogDatabase; -import org.openecomp.mso.db.catalog.beans.NetworkRecipe; -import org.openecomp.mso.db.catalog.beans.VfModule; -import org.openecomp.mso.db.catalog.beans.VnfResource; -import org.openecomp.mso.properties.MsoPropertiesFactory; -import org.openecomp.mso.requestsdb.InfraActiveRequests; -import org.openecomp.mso.requestsdb.InfraRequests; -import org.openecomp.mso.requestsdb.RequestsDatabase; - -import javax.ws.rs.core.Response; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.sql.Timestamp; -import java.time.LocalDateTime; -import java.util.Collections; -import java.util.List; - -public class VolumeInfoHandlerTest { - - VolumeInfoHandler handler = new VolumeInfoHandler(); - - private static MockUp<RequestsDatabase> mockRDB; - - @BeforeClass - public static void setUp() throws Exception { - MsoPropertiesFactory msoPropertiesFactory = new MsoPropertiesFactory(); - msoPropertiesFactory.removeAllMsoProperties(); - msoPropertiesFactory.initializeMsoProperties(Constants.MSO_PROP_APIHANDLER_INFRA, "src/test/resources/mso.apihandler-infra.properties"); - - mockRDB = new MockUp<RequestsDatabase>() { - @Mock - public List<InfraActiveRequests> getRequestListFromInfraActive (String queryAttributeName, - String queryValue, - String requestType) { - final InfraActiveRequests requests = new InfraActiveRequests(); - requests.setAction(ActionType.CREATE.name()); - requests.setRequestStatus(RequestStatusType.IN_PROGRESS.name()); - requests.setStartTime(Timestamp.valueOf(LocalDateTime.now())); - return Collections.singletonList(requests); - } - @Mock - public InfraActiveRequests getRequestFromInfraActive (String requestId, String requestType) { - final InfraActiveRequests requests = new InfraActiveRequests(); - requests.setAction(ActionType.CREATE.name()); - requests.setRequestStatus(RequestStatusType.IN_PROGRESS.name()); - requests.setStartTime(Timestamp.valueOf(LocalDateTime.now())); - return requests; - } - }; - - } - - @AfterClass - public static void tearDown() { - mockRDB.tearDown(); - } - - @Test - public void fillVnfRequestTestV3(){ - VolumeRequest qr = new VolumeRequest(); - InfraRequests ar = new InfraRequests(); - ar.setVnfId("2990102"); - ar.setVnfParams("test"); - handler.fillVolumeRequest(qr, ar, "v3"); - String vnfid = (String)qr.getVolumeParams(); - assertTrue(vnfid.equals("test")); - } - - @Test - public void fillVnfRequestTestV2(){ - VolumeRequest qr = new VolumeRequest(); - InfraRequests ar = new InfraRequests(); - ar.setVnfId("2990102"); - ar.setVnfParams("test"); - handler.fillVolumeRequest(qr, ar, "v2"); - String vnfid = (String)qr.getVolumeParams(); - assertTrue(vnfid.equals("test")); - } - - @Test - public void queryFilters() { - final Response response = handler.queryFilters("vnf-type", "svc-type", "aicNode", "tenant-id", - "vg-id", "vg-name", "v3"); - } - - @Test - public void queryFilters2() { - final Response response = handler.queryFilters(null, "svc-type", "aicNode", "tenant-id", - "vg-id", "vg-name", "v3"); - } - - @Test - public void getRequest() { - final Response response = handler.getRequest("request-id", "v3"); - } -} diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VolumeRequestHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VolumeRequestHandlerTest.java deleted file mode 100644 index e2fcca5011..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/VolumeRequestHandlerTest.java +++ /dev/null @@ -1,212 +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.apihandlerinfra; - -import static org.junit.Assert.assertTrue; - -import java.lang.reflect.Field; -import java.net.URI; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.List; - -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; - -import mockit.Mock; -import mockit.MockUp; - -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mockito; -import org.openecomp.mso.apihandler.common.ValidationException; -import org.openecomp.mso.properties.MsoJavaProperties; -import org.openecomp.mso.requestsdb.InfraActiveRequests; -import org.openecomp.mso.requestsdb.RequestsDatabase; - -public class VolumeRequestHandlerTest { - VolumeRequestHandler handler = null; - - UriInfo uriInfo = null; - - @Before - public void setup() throws Exception{ - - uriInfo = Mockito.mock(UriInfo.class); - Class<?> clazz = VolumeRequestHandler.class; - handler = (VolumeRequestHandler)clazz.newInstance(); - - Field f1 = handler.getClass().getDeclaredField("uriInfo"); - - f1.setAccessible(true); - f1.set(handler, uriInfo); - } - - @Test - public void manageVnfRequestTest(){ - Mockito.when(uriInfo.getRequestUri()).thenReturn(URI.create("http://localhost:8080/test")); - Response resp = handler.manageVolumeRequest("<name>Test</name>", "v2"); - assertTrue(null != resp); - } - - @Test - public void manageVnfRequest2TestV1InvalidRequestData(){ - Mockito.when(uriInfo.getRequestUri()) - .thenReturn(URI.create("http://localhost:8080/test")); - - new MockUp<MsoPropertiesUtils>() { - @Mock - public synchronized final boolean getNoPropertiesState() { - return false; - } - }; - String request = "{\"result\":\"success\"}"; - Response resp = handler.manageVolumeRequest(request, "v1"); - assertTrue(null != resp); - } - - @Test - public void manageVnfRequest2TestV1(){ - Mockito.when(uriInfo.getRequestUri()) - .thenReturn(URI.create("http://localhost:8080/test")); - - new MockUp<MsoPropertiesUtils>() { - @Mock - public synchronized final boolean getNoPropertiesState() { - return false; - } - }; - String request = "<volume-request xmlns=\"http://org.openecomp/mso/infra/volume-request/v1\"><request-info><action>CREATE</action><request-status>COMPLETE</request-status><status-message>message</status-message><progress>10001</progress><start-time>1970-01-01 02:47:00.1</start-time><end-time>1970-01-01 05:33:40.1</end-time><source>test</source></request-info><volume-inputs><service-id>299392</service-id></volume-inputs></volume-request>"; - Response resp = handler.manageVolumeRequest(request, "v1"); - assertTrue(null != resp); - } - - @Test - public void manageVnfRequest2TestV2(){ - Mockito.when(uriInfo.getRequestUri()) - .thenReturn(URI.create("http://localhost:8080/test")); - - new MockUp<MsoPropertiesUtils>() { - @Mock - public synchronized final boolean getNoPropertiesState() { - return false; - } - }; - String request = "<volume-request xmlns=\"http://org.openecomp/mso/infra/volume-request/v2\"><request-info><action>CREATE</action><request-status>COMPLETE</request-status><status-message>message</status-message><progress>10001</progress><start-time>1970-01-01 02:47:00.1</start-time><end-time>1970-01-01 05:33:40.1</end-time><source>test</source></request-info><volume-inputs><service-id>299392</service-id></volume-inputs></volume-request>"; - Response resp = handler.manageVolumeRequest(request, "v2"); - assertTrue(null != resp); - } - @Test - public void manageVnfRequest2TestV3(){ - Mockito.when(uriInfo.getRequestUri()) - .thenReturn(URI.create("http://localhost:8080/test")); - - new MockUp<MsoPropertiesUtils>() { - @Mock - public synchronized final boolean getNoPropertiesState() { - return false; - } - }; - String request = "<volume-request xmlns=\"http://org.openecomp/mso/infra/volume-request/v3\"><request-info><action>CREATE</action><request-status>COMPLETE</request-status><status-message>message</status-message><progress>10001</progress><start-time>1970-01-01 02:47:00.1</start-time><end-time>1970-01-01 05:33:40.1</end-time><source>test</source></request-info><volume-inputs><service-id>299392</service-id></volume-inputs></volume-request>"; - Response resp = handler.manageVolumeRequest(request, "v3"); - assertTrue(null != resp); - } - @Test - public void manageVnfRequest2TestInvalidVersion(){ - Mockito.when(uriInfo.getRequestUri()) - .thenReturn(URI.create("http://localhost:8080/test")); - - new MockUp<MsoPropertiesUtils>() { - @Mock - public synchronized final boolean getNoPropertiesState() { - return false; - } - }; - String request = "<volume-request xmlns=\"http://org.openecomp/mso/infra/volume-request/v1\"><request-info><action>CREATE</action><request-status>COMPLETE</request-status><status-message>message</status-message><progress>10001</progress><start-time>1970-01-01 02:47:00.1</start-time><end-time>1970-01-01 05:33:40.1</end-time><source>test</source></request-info><volume-inputs><service-id>299392</service-id></volume-inputs></volume-request>"; - Response resp = handler.manageVolumeRequest(request, "v33"); - assertTrue(null != resp); - } - - @Test - public void queryFiltersTest(){ - new MockUp<RequestsDatabase>() { - @Mock - public List <InfraActiveRequests> getRequestListFromInfraActive (String queryAttributeName, - String queryValue, - String requestType) { - List <InfraActiveRequests> list = new ArrayList<>(); - InfraActiveRequests req = new InfraActiveRequests(); - req.setAaiServiceId("299392"); - req.setAction("CREATE"); - req.setRequestStatus("COMPLETE"); - req.setProgress(10001L); - req.setSource("test"); - req.setStartTime(new Timestamp(10020100)); - req.setEndTime(new Timestamp(20020100)); - req.setStatusMessage("message"); - list.add(req); - return list; - } - }; - Response resp = handler.queryFilters("vnfType", "serviceType", "aic", "19929293", "288393923", "test", "v1"); - assertTrue(resp.getEntity().toString() != null); - } - @Test - public void getRequestTestV3(){ - new MockUp<RequestsDatabase>() { - @Mock - public InfraActiveRequests getRequestFromInfraActive (String requestId, String requestType) { - InfraActiveRequests req = new InfraActiveRequests(); - req.setAaiServiceId("299392"); - req.setAction("CREATE"); - req.setRequestStatus("COMPLETE"); - req.setProgress(10001L); - req.setSource("test"); - req.setStartTime(new Timestamp(10020100)); - req.setEndTime(new Timestamp(20020100)); - req.setStatusMessage("message"); - return req; - } - }; - Response resp = handler.getRequest("399293", "v3"); - assertTrue(resp.getEntity().toString() != null); - } - @Test - public void getRequestTestV2(){ - new MockUp<RequestsDatabase>() { - @Mock - public InfraActiveRequests getRequestFromInfraActive (String requestId, String requestType) { - InfraActiveRequests req = new InfraActiveRequests(); - req.setAaiServiceId("299392"); - req.setAction("CREATE"); - req.setRequestStatus("COMPLETE"); - req.setProgress(10001L); - req.setSource("test"); - req.setStartTime(new Timestamp(10020100)); - req.setEndTime(new Timestamp(20020100)); - req.setStatusMessage("message"); - return req; - } - }; - Response resp = handler.getRequest("399293", "v2"); - assertTrue(resp.getEntity().toString() != null); - } -} diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/networkbeans/NetworkOutputsTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/networkbeans/NetworkOutputsTest.java deleted file mode 100644 index 3920094dc6..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/networkbeans/NetworkOutputsTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 Huawei 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.apihandlerinfra.networkbeans; - -import org.junit.Test; - -public class NetworkOutputsTest { - // TODO: currently test case is done for coverage - // later, it should be modified properly. - - NetworkOutputs test = new NetworkOutputs(); - - @Test - public void getNetworkIdTest() throws Exception { - test.getNetworkId(); - } - - @Test - public void setNetworkIdTest() throws Exception { - test.setNetworkId("id"); - } - - @Test - public void getNetworkNameTest() throws Exception { - test.getNetworkName(); - } - - @Test - public void setNetworkNameTest() throws Exception { - test.setNetworkName("name"); - } -} diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/ObjectFactoryTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/ObjectFactoryTest.java deleted file mode 100644 index 228fc2fa87..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/ObjectFactoryTest.java +++ /dev/null @@ -1,38 +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.apihandlerinfra.volumebeans;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-public class ObjectFactoryTest {
- ObjectFactory of = new ObjectFactory();
- Object o = new Object();
- @Test
- public void testObjectFactory() {
- of.createRequestInfo();
- of.createVolumeRequest();
- of.createVolumeInputs();
- of.createVolumeOutputs();
- of.createVolumeRequests();
- of.createVolumeParams(o);
- }
-}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/RequestInfoTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/RequestInfoTest.java deleted file mode 100644 index b452c91034..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/RequestInfoTest.java +++ /dev/null @@ -1,50 +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.apihandlerinfra.volumebeans;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-public class RequestInfoTest {
- RequestInfo ri = new RequestInfo();
- ActionType actiontype = ActionType.CREATE;
- RequestStatusType requestStatustype = RequestStatusType.COMPLETE;
- int abc;
- @Test
- public void testRequestInfo() {
- ri.setRequestId("requestId");
- ri.setAction(actiontype);
- ri.setRequestStatus(requestStatustype);
- ri.setStatusMessage("statusMessage");
- ri.setProgress(abc);
- ri.setStartTime("startTime");
- ri.setEndTime("endTime");
- ri.setSource("source");
- assertEquals(ri.getRequestId(), "requestId");
- assertEquals(ri.getAction(), actiontype);
- assertEquals(ri.getRequestStatus(), requestStatustype);
- assertEquals(ri.getStatusMessage(), "statusMessage");
- assert(ri.getProgress().equals(abc));
- assertEquals(ri.getStartTime(), "startTime");
- assertEquals(ri.getEndTime(), "endTime");
- assertEquals(ri.getSource(), "source");
- }
-}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeInputsTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeInputsTest.java deleted file mode 100644 index 8fd3ea0505..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeInputsTest.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.apihandlerinfra.volumebeans;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-public class VolumeInputsTest {
-
- VolumeInputs vi = new VolumeInputs();
- @Test
- public void testVolumeInputs() {
- vi.setVolumeGroupId("volumeGroupId");
- vi.setVolumeGroupName("volumeGroupName");
- vi.setVnfType("vnfType");
- vi.setVnfId("vnfId");
- vi.setServiceInstanceId("serviceInstanceId");
- vi.setServiceType("serviceType");
- vi.setServiceId("serviceId");
- vi.setAicNodeClli("aicNodeClli");
- vi.setAicCloudRegion("aicCloudRegion");
- vi.setTenantId("tenantId");
- vi.setVfModuleModelName("vfModuleModelName");
- vi.setAsdcServiceModelVersion("asdcServiceModelVersion");
- vi.setBackoutOnFailure(true);
- assertEquals(vi.getVolumeGroupId(), "volumeGroupId");
- assertEquals(vi.getVolumeGroupName(), "volumeGroupName");
- assertEquals(vi.getVnfType(), "vnfType");
- assertEquals(vi.getVnfId(), "vnfId");
- assertEquals(vi.getServiceInstanceId(), "serviceInstanceId");
- assertEquals(vi.getServiceType(), "serviceType");
- assertEquals(vi.getServiceId(), "serviceId");
- assertEquals(vi.getAicNodeClli(), "aicNodeClli");
- assertEquals(vi.getAicCloudRegion(), "aicCloudRegion");
- assertEquals(vi.getTenantId(), "tenantId");
- assertEquals(vi.getVfModuleModelName(), "vfModuleModelName");
- assertEquals(vi.getAsdcServiceModelVersion(), "asdcServiceModelVersion");
- assertEquals(vi.getBackoutOnFailure(), true);
- }
-}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeOutputsTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeOutputsTest.java deleted file mode 100644 index f8a65bfa42..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeOutputsTest.java +++ /dev/null @@ -1,44 +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.apihandlerinfra.volumebeans;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-public class VolumeOutputsTest {
-
- VolumeOutputs vo = new VolumeOutputs();
- @Test
- public void testVolumeOutputs() {
- vo.setVolumeGroupId("volumeGroupId");
- vo.setVolumeGroupName("volumeGroupName");
- vo.setVnfType("vnfType");
- vo.setServiceType("serviceType");
- vo.setAicNodeClli("aicNodeClli");
- vo.setTenantId("tenantId");
- assertEquals(vo.getVolumeGroupId(), "volumeGroupId");
- assertEquals(vo.getVolumeGroupName(), "volumeGroupName");
- assertEquals(vo.getVnfType(), "vnfType");
- assertEquals(vo.getServiceType(), "serviceType");
- assertEquals(vo.getAicNodeClli(), "aicNodeClli");
- assertEquals(vo.getTenantId(), "tenantId");
- }
-}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeRequestTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeRequestTest.java deleted file mode 100644 index 1e0152ef61..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeRequestTest.java +++ /dev/null @@ -1,44 +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.apihandlerinfra.volumebeans;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-public class VolumeRequestTest {
-
- VolumeRequest vr = new VolumeRequest();
- RequestInfo ri = new RequestInfo();
- VolumeInputs vi = new VolumeInputs();
- VolumeOutputs vo = new VolumeOutputs();
- Object o = new Object();
- @Test
- public void testVolumeRequest() {
- vr.setRequestInfo(ri);
- vr.setVolumeInputs(vi);
- vr.setVolumeOutputs(vo);
- vr.setVolumeParams(o);
- assertEquals(vr.getRequestInfo(), ri);
- assertEquals(vr.getVolumeInputs(), vi);
- assertEquals(vr.getVolumeOutputs(), vo);
- assertEquals(vr.getVolumeParams(), o);
- }
-}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeRequestsTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeRequestsTest.java deleted file mode 100644 index 0d2c6037a6..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/volumebeans/VolumeRequestsTest.java +++ /dev/null @@ -1,32 +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.apihandlerinfra.volumebeans;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-public class VolumeRequestsTest {
- VolumeRequests vrs = new VolumeRequests();
- @Test
- public void testVolumeRequests() {
- vrs.getVolumeRequest();
- }
-}
|