From 10b21aae2bde224ab7f91f4b5ab1b89369c8fd1c Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Wed, 8 May 2019 14:33:57 -0400 Subject: Add payload to vFW policy yaml Added new "streams" payload to vFW policy yaml files. Removed references to pg-streams. Also deleted directories that were moved to policy/models. Also removed references to trafficgenerator. Updated licenses. Removed some trailing whitespace. Change-Id: I6becaa573628eee677f0959fadf86f9a9f032f88 Issue-ID: POLICY-1752 Signed-off-by: Jim Hahn --- .../org/onap/policy/aai/AaiGetResponseTest.java | 61 ----- .../org/onap/policy/aai/AaiGetVnfResponseTest.java | 107 --------- .../onap/policy/aai/AaiGetVserverResponseTest.java | 77 ------ .../java/org/onap/policy/aai/AaiManagerTest.java | 169 ------------- .../org/onap/policy/aai/AaiNqCloudRegionTest.java | 53 ----- .../onap/policy/aai/AaiNqExtraPropertiesTest.java | 50 ---- .../onap/policy/aai/AaiNqExtraPropertyTest.java | 48 ---- .../org/onap/policy/aai/AaiNqGenericVnfTest.java | 81 ------- .../onap/policy/aai/AaiNqInstanceFiltersTest.java | 47 ---- .../policy/aai/AaiNqInventoryResponseItemTest.java | 170 -------------- .../aai/AaiNqInventoryResponseItemsTest.java | 163 ------------- .../org/onap/policy/aai/AaiNqNamedQueryTest.java | 48 ---- .../onap/policy/aai/AaiNqQueryParametersTest.java | 50 ---- .../org/onap/policy/aai/AaiNqRequestErrorTest.java | 41 ---- .../java/org/onap/policy/aai/AaiNqRequestTest.java | 68 ------ .../org/onap/policy/aai/AaiNqResponseTest.java | 160 ------------- .../onap/policy/aai/AaiNqResponseWrapperTest.java | 261 --------------------- .../onap/policy/aai/AaiNqServiceInstanceTest.java | 65 ----- .../java/org/onap/policy/aai/AaiNqTenantTest.java | 56 ----- .../java/org/onap/policy/aai/AaiNqVServerTest.java | 101 -------- .../org/onap/policy/aai/AaiNqVfModuleTest.java | 79 ------- .../java/org/onap/policy/aai/PnfInstanceTest.java | 105 --------- .../src/test/java/org/onap/policy/aai/PnfTest.java | 77 ------ .../test/java/org/onap/policy/aai/PnfTypeTest.java | 50 ---- .../org/onap/policy/aai/RelatedToPropertyTest.java | 56 ----- .../org/onap/policy/aai/RelationshipDataTest.java | 56 ----- .../org/onap/policy/aai/RelationshipListTest.java | 66 ------ .../java/org/onap/policy/aai/RelationshipTest.java | 88 ------- .../org/onap/policy/aai/util/AaiExceptionTest.java | 40 ---- .../org/onap/policy/aai/AaiGetResponseError.json | 14 -- .../org/onap/policy/aai/AaiGetVnfResponse.json | 123 ---------- .../org/onap/policy/aai/AaiGetVserverResponse.json | 82 ------- .../policy/aai/AaiNqResponseWrapper-NoItems.json | 96 -------- .../policy/aai/AaiNqResponseWrapper-NoModules.json | 133 ----------- .../policy/aai/AaiNqResponseWrapper-NoNames.json | 133 ----------- .../policy/aai/AaiNqResponseWrapper-Vserver.json | 157 ------------- .../org/onap/policy/aai/AaiNqVServer.json | 78 ------ .../org/onap/policy/aai/RelatedToProperty.json | 4 - .../org/onap/policy/aai/Relationship.json | 25 -- .../org/onap/policy/aai/RelationshipData.json | 4 - .../org/onap/policy/aai/RelationshipList.json | 68 ------ 41 files changed, 3410 deletions(-) delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetResponseTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetVnfResponseTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetVserverResponseTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiManagerTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqCloudRegionTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqExtraPropertiesTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqExtraPropertyTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqGenericVnfTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqInstanceFiltersTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqInventoryResponseItemTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqInventoryResponseItemsTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqNamedQueryTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqQueryParametersTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqRequestErrorTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqRequestTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqResponseTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqResponseWrapperTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqServiceInstanceTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqTenantTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqVServerTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqVfModuleTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/PnfInstanceTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/PnfTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/PnfTypeTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelatedToPropertyTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipDataTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipListTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/util/AaiExceptionTest.java delete mode 100644 controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetResponseError.json delete mode 100644 controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetVnfResponse.json delete mode 100644 controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetVserverResponse.json delete mode 100644 controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqResponseWrapper-NoItems.json delete mode 100644 controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqResponseWrapper-NoModules.json delete mode 100644 controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqResponseWrapper-NoNames.json delete mode 100644 controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqResponseWrapper-Vserver.json delete mode 100644 controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqVServer.json delete mode 100644 controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelatedToProperty.json delete mode 100644 controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/Relationship.json delete mode 100644 controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelationshipData.json delete mode 100644 controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelationshipList.json (limited to 'controlloop/common/model-impl/aai/src/test') diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetResponseTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetResponseTest.java deleted file mode 100644 index 9afa70a59..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetResponseTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; - -import java.io.File; -import java.nio.file.Files; -import org.junit.Test; -import org.onap.policy.aai.util.Serialization; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class AaiGetResponseTest { - private static final Logger logger = LoggerFactory.getLogger(AaiGetResponseTest.class); - - @Test - public void test() throws Exception { - // deserialize json and verify fields are populated properly - String json = new String(Files.readAllBytes( - new File("src/test/resources/org/onap/policy/aai/AaiGetResponseError.json").toPath())); - - AaiGetResponse resp = Serialization.gsonPretty.fromJson(json, AaiGetResponse.class); - - // don't need to verify this in depth, as it has its own tests that do that - assertNotNull(resp.getRequestError()); - assertNotNull(resp.getRequestError().getServiceExcept()); - assertEquals("SVC3001", resp.getRequestError().getServiceExcept().getMessageId()); - - logger.info(Serialization.gsonPretty.toJson(resp)); - - // verify that setXxx methods work - resp.setRequestError(null); - assertNull(resp.getRequestError()); - - AaiNqRequestError err = new AaiNqRequestError(); - resp.setRequestError(err); - assertEquals(err, resp.getRequestError()); - } - -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetVnfResponseTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetVnfResponseTest.java deleted file mode 100644 index 26f3ca2dc..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetVnfResponseTest.java +++ /dev/null @@ -1,107 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import java.io.File; -import java.nio.file.Files; -import java.util.List; -import org.junit.Test; -import org.onap.policy.aai.util.Serialization; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class AaiGetVnfResponseTest { - private static final Logger logger = LoggerFactory.getLogger(AaiGetVnfResponseTest.class); - - @Test - public void test() throws Exception { - // deserialize json and verify fields are populated properly - String json = new String(Files.readAllBytes( - new File("src/test/resources/org/onap/policy/aai/AaiGetVnfResponse.json").toPath())); - - AaiGetVnfResponse resp = Serialization.gsonPretty.fromJson(json, AaiGetVnfResponse.class); - - assertEquals("807a3f02-f878-436b-870c-f0e91e81570d", resp.getVnfId()); - assertEquals("vLoadBalancerMS-Vnf-0809-2", resp.getVnfName()); - assertEquals("vLoadBalancerMS/vLoadBalancerMS 0", resp.getVnfType()); - assertEquals("1533850960381", resp.getResourceVersion()); - assertEquals(false, resp.getInMaint()); - assertEquals(true, resp.getIsClosedLoopDisabled()); - assertEquals("53638a85-361a-437d-8830-4b0d5329225e", resp.getModelInvariantId()); - assertEquals("PROV", resp.getProvStatus()); - assertEquals("Active", resp.getOrchestrationStatus()); - assertEquals("50e1b0be-e0c9-48e2-9f42-15279a783ee8", resp.getServiceId()); - - // don't need to verify this in depth, as it has its own tests that do that - RelationshipList relationshipList = resp.getRelationshipList(); - assertNotNull(relationshipList); - - List lst = relationshipList.getRelationships(); - assertNotNull(lst); - - assertEquals(5, lst.size()); - assertEquals("service-instance", lst.get(0).getRelatedTo()); - assertEquals("line-of-business", lst.get(1).getRelatedTo()); - - logger.info(Serialization.gsonPretty.toJson(resp)); - - // verify that setXxx methods work - relationshipList = new RelationshipList(); - - resp.setInMaint(true); - resp.setIsClosedLoopDisabled(false); - resp.setModelInvariantId("modiv"); - resp.setOrchestrationStatus("orch"); - resp.setProvStatus("mystatus"); - resp.setRelationshipList(relationshipList); - resp.setResourceVersion("vers"); - resp.setServiceId("svc"); - resp.setVnfId("vnfid"); - resp.setVnfName("vnfname"); - resp.setVnfType("vnftype"); - - assertEquals("vnfid", resp.getVnfId()); - assertEquals("vnfname", resp.getVnfName()); - assertEquals("vnftype", resp.getVnfType()); - assertEquals("vers", resp.getResourceVersion()); - assertEquals(true, resp.getInMaint()); - assertEquals(false, resp.getIsClosedLoopDisabled()); - assertEquals("modiv", resp.getModelInvariantId()); - assertEquals("mystatus", resp.getProvStatus()); - assertEquals("orch", resp.getOrchestrationStatus()); - assertEquals("svc", resp.getServiceId()); - assertEquals(relationshipList, resp.getRelationshipList()); - - - // test error case - json = new String(Files.readAllBytes( - new File("src/test/resources/org/onap/policy/aai/AaiGetResponseError.json").toPath())); - resp = Serialization.gsonPretty.fromJson(json, AaiGetVnfResponse.class); - - // don't need to verify this in depth, as it has its own tests that do that - assertNotNull(resp.getRequestError()); - assertNotNull(resp.getRequestError().getServiceExcept()); - assertEquals("SVC3001", resp.getRequestError().getServiceExcept().getMessageId()); - } -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetVserverResponseTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetVserverResponseTest.java deleted file mode 100644 index c0160e421..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetVserverResponseTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import java.io.File; -import java.nio.file.Files; -import java.util.LinkedList; -import java.util.List; -import org.junit.Test; -import org.onap.policy.aai.util.Serialization; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class AaiGetVserverResponseTest { - private static final Logger logger = LoggerFactory.getLogger(AaiGetVserverResponseTest.class); - - @Test - public void test() throws Exception { - // deserialize json and verify fields are populated properly - String json = new String(Files.readAllBytes( - new File("src/test/resources/org/onap/policy/aai/AaiGetVserverResponse.json").toPath())); - - AaiGetVserverResponse resp = Serialization.gsonPretty.fromJson(json, AaiGetVserverResponse.class); - - // don't need to verify this in depth, as it has its own tests that do that - List lst = resp.getVserver(); - assertEquals(1, lst.size()); - - AaiNqVServer svr = lst.get(0); - assertNotNull(svr); - assertEquals("1c94da3f-16f1-4fc7-9ed1-e018dfa62774", svr.getVserverId()); - - logger.info(Serialization.gsonPretty.toJson(resp)); - - // verify that setXxx methods work - lst = new LinkedList<>(); - lst.add(new AaiNqVServer()); - lst.add(new AaiNqVServer()); - - resp.setVserver(lst); - - assertEquals(lst, resp.getVserver()); - - - // test error case - json = new String(Files.readAllBytes( - new File("src/test/resources/org/onap/policy/aai/AaiGetResponseError.json").toPath())); - resp = Serialization.gsonPretty.fromJson(json, AaiGetVserverResponse.class); - - // don't need to verify this in depth, as it has its own tests that do that - assertNotNull(resp.getRequestError()); - assertNotNull(resp.getRequestError().getServiceExcept()); - assertEquals("SVC3001", resp.getRequestError().getServiceExcept().getMessageId()); - } - -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiManagerTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiManagerTest.java deleted file mode 100644 index 3717740d5..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiManagerTest.java +++ /dev/null @@ -1,169 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2019 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.onap.policy.aai; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.mockito.ArgumentMatchers.anyMap; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.ArgumentMatchers.isNull; -import static org.mockito.ArgumentMatchers.startsWith; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import org.junit.Before; -import org.junit.Test; -import org.onap.policy.aai.util.Serialization; -import org.onap.policy.rest.RestManager; -import org.onap.policy.rest.RestManager.Pair; - -public class AaiManagerTest { - RestManager restManagerMock; - UUID aaiNqRequestUuid = UUID.randomUUID(); - Pair httpResponseOk; - Pair httpResponseErr0; - Pair httpResponseErr1; - Pair httpResponseWait; - - /** - * Set up test cases. - */ - @Before - public void beforeTestAaiManager() { - restManagerMock = mock(RestManager.class); - - Map expectedHeaders = new HashMap<>(); - expectedHeaders.put("X-FromAppId", "POLICY"); - expectedHeaders.put("X-TransactionId", aaiNqRequestUuid.toString()); - expectedHeaders.put("Accept", "application/json"); - - AaiNqResponse aaiNqResponse = new AaiNqResponseTest().getAaiNqResponse(); - httpResponseOk = restManagerMock.new Pair<>(200, Serialization.gsonPretty.toJson(aaiNqResponse)); - httpResponseErr0 = restManagerMock.new Pair<>(200, null); - httpResponseErr1 = restManagerMock.new Pair<>(200, "{"); - httpResponseWait = restManagerMock.new Pair<>(503, null); - } - - @Test - public void testAaiManagerAaiNqRequest() { - - AaiManager aaiManager = new AaiManager(restManagerMock); - assertNotNull(aaiManager); - - UUID aaiNqUuid = UUID.randomUUID(); - - AaiNqQueryParameters aaiNqQueryParameters = new AaiNqQueryParameters(); - AaiNqNamedQuery aaiNqNamedQuery = new AaiNqNamedQuery(); - aaiNqNamedQuery.setNamedQueryUuid(aaiNqUuid); - aaiNqQueryParameters.setNamedQuery(aaiNqNamedQuery); - - AaiNqRequest aaiNqRequest = new AaiNqRequest(); - aaiNqRequest.setQueryParameters(aaiNqQueryParameters); - - when(restManagerMock.post(startsWith("http://somewhere.over.the.rainbow"), eq("Dorothy"), eq("Gale"), anyMap(), - anyString(), anyString())).thenReturn(httpResponseOk); - - AaiNqResponse aaiNqOkResponse = aaiManager.postQuery("http://somewhere.over.the.rainbow", "Dorothy", "Gale", - aaiNqRequest, aaiNqRequestUuid); - assertNotNull(aaiNqOkResponse); - - when(restManagerMock.post(isNull(), eq("Dorothy"), anyString(), anyMap(), anyString(), anyString())) - .thenReturn(null); - - AaiNqResponse aaiNqNullResponse = aaiManager.postQuery(null, "Dorothy", "Gale", null, aaiNqRequestUuid); - assertNull(aaiNqNullResponse); - - when(restManagerMock.post(startsWith("http://somewhere.over.the.rainbow"), eq("Witch"), eq("West"), anyMap(), - anyString(), anyString())).thenReturn(httpResponseErr0); - - AaiNqResponse aaiNqNotOkResponse0 = aaiManager.postQuery("http://somewhere.over.the.rainbow", "Witch", "West", - aaiNqRequest, aaiNqRequestUuid); - assertNull(aaiNqNotOkResponse0); - - when(restManagerMock.post(startsWith("http://somewhere.under.the.rainbow"), eq("Witch"), eq("West"), anyMap(), - anyString(), anyString())).thenReturn(httpResponseErr1); - - AaiNqResponse aaiNqNotOkResponse1 = aaiManager.postQuery("http://somewhere.under.the.rainbow", "Witch", "West", - aaiNqRequest, aaiNqRequestUuid); - assertNull(aaiNqNotOkResponse1); - } - - @Test - public void testAaiManagerQueryByVserverName() { - AaiManager aaiManager = new AaiManager(restManagerMock); - assertNotNull(aaiManager); - - UUID vserverNameRequestId = UUID.randomUUID(); - - when(restManagerMock.get(startsWith("http://somewhere.over.the.rainbow"), eq("Dorothy"), eq("Gale"), anyMap())) - .thenReturn(httpResponseOk); - - AaiGetVserverResponse vserverResponse = aaiManager.getQueryByVserverName("http://somewhere.over.the.rainbow", - "Dorothy", "Gale", vserverNameRequestId, "vserverName"); - assertNotNull(vserverResponse); - - AaiGetVserverResponse vserverNullResponse = - aaiManager.getQueryByVserverName(null, "Dorothy", "Gale", vserverNameRequestId, "vserverName"); - assertNull(vserverNullResponse); - - when(restManagerMock.get(startsWith("http://somewhere.under.the.rainbow"), eq("Witch"), eq("West"), anyMap())) - .thenReturn(httpResponseErr0); - - AaiGetVserverResponse vserverNotOkResponse0 = aaiManager.getQueryByVserverName( - "http://somewhere.under.the.rainbow", "Witch", "West", vserverNameRequestId, "vserverName"); - assertNull(vserverNotOkResponse0); - } - - @Test - public void testAaiManagerQueryByVnfId() { - AaiManager aaiManager = new AaiManager(restManagerMock); - assertNotNull(aaiManager); - - UUID vserverNameRequestId = UUID.randomUUID(); - - when(restManagerMock.get(startsWith("http://somewhere.over.the.rainbow"), eq("Dorothy"), eq("Gale"), anyMap())) - .thenReturn(httpResponseOk); - - AaiGetVnfResponse vnfResponse = aaiManager.getQueryByVnfId("http://somewhere.over.the.rainbow", "Dorothy", - "Gale", vserverNameRequestId, "vnfID"); - assertNotNull(vnfResponse); - } - - @Test - public void testAaiManagerQueryByVnfName() { - AaiManager aaiManager = new AaiManager(restManagerMock); - assertNotNull(aaiManager); - - UUID vserverNameRequestId = UUID.randomUUID(); - - when(restManagerMock.get(startsWith("http://somewhere.over.the.rainbow"), eq("Dorothy"), eq("Gale"), anyMap())) - .thenReturn(httpResponseOk); - - AaiGetVnfResponse vnfResponse = aaiManager.getQueryByVnfId("http://somewhere.over.the.rainbow", "Dorothy", - "Gale", vserverNameRequestId, "vnfName"); - assertNotNull(vnfResponse); - } -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqCloudRegionTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqCloudRegionTest.java deleted file mode 100644 index dea981a0a..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqCloudRegionTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -public class AaiNqCloudRegionTest { - - @BeforeClass - public static void setUpBeforeClass() throws Exception {} - - @AfterClass - public static void tearDownAfterClass() throws Exception {} - - @Test - public void test() { - AaiNqCloudRegion aaiNqCloudRegion = new AaiNqCloudRegion(); - aaiNqCloudRegion.setCloudOwner("Rackspace"); - aaiNqCloudRegion.setCloudRegionId("DFW"); - aaiNqCloudRegion.setCloudRegionVersion("v1"); - aaiNqCloudRegion.setComplexName("SharedNode"); - aaiNqCloudRegion.setResourceVersion("1504789196021"); - assertNotNull(aaiNqCloudRegion); - assertEquals("Rackspace", aaiNqCloudRegion.getCloudOwner()); - assertEquals("DFW", aaiNqCloudRegion.getCloudRegionId()); - assertEquals("v1", aaiNqCloudRegion.getCloudRegionVersion()); - assertEquals("SharedNode", aaiNqCloudRegion.getComplexName()); - assertEquals("1504789196021", aaiNqCloudRegion.getResourceVersion()); - } -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqExtraPropertiesTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqExtraPropertiesTest.java deleted file mode 100644 index adbd9379b..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqExtraPropertiesTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertNotNull; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -public class AaiNqExtraPropertiesTest { - - @BeforeClass - public static void setUpBeforeClass() throws Exception {} - - @AfterClass - public static void tearDownAfterClass() throws Exception {} - - @Test - public void test() { - AaiNqExtraProperties aaiNqExtraProperties = new AaiNqExtraProperties(); - aaiNqExtraProperties.getExtraProperty().add(new AaiNqExtraProperty("model.model-name", "service-instance")); - aaiNqExtraProperties.getExtraProperty().add(new AaiNqExtraProperty("model.model-type", "widget")); - aaiNqExtraProperties.getExtraProperty().add(new AaiNqExtraProperty("model.model-version", "1.0")); - aaiNqExtraProperties.getExtraProperty() - .add(new AaiNqExtraProperty("model.model-id", "82194af1-3c2c-485a-8f44-420e22a9eaa4")); - aaiNqExtraProperties.getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name", "46b92144-923a-4d20-b85a-3cbd847668a9")); - assertNotNull(aaiNqExtraProperties); - } - -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqExtraPropertyTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqExtraPropertyTest.java deleted file mode 100644 index 25f125945..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqExtraPropertyTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -public class AaiNqExtraPropertyTest { - - @BeforeClass - public static void setUpBeforeClass() throws Exception {} - - @AfterClass - public static void tearDownAfterClass() throws Exception {} - - @Test - public void test() { - AaiNqExtraProperty aaiNqExtraProperty = new AaiNqExtraProperty(); - aaiNqExtraProperty.setPropertyName("model.model-name"); - aaiNqExtraProperty.setPropertyValue("service-instance"); - assertNotNull(aaiNqExtraProperty); - - assertEquals("model.model-name", aaiNqExtraProperty.getPropertyName()); - assertEquals("service-instance", aaiNqExtraProperty.getPropertyValue()); - } -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqGenericVnfTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqGenericVnfTest.java deleted file mode 100644 index 7a94dccf0..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqGenericVnfTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -public class AaiNqGenericVnfTest { - - @BeforeClass - public static void setUpBeforeClass() throws Exception {} - - @AfterClass - public static void tearDownAfterClass() throws Exception {} - - @Test - public void test() { - AaiNqGenericVnf aaiNqGenericVnf = new AaiNqGenericVnf(); - aaiNqGenericVnf.setEncrypedAccessFlag(true); - aaiNqGenericVnf.setInMaint(false); - aaiNqGenericVnf.setIpv4Loopback0Address("aa"); - aaiNqGenericVnf.setIpv4OamAddress("oamAddress"); - aaiNqGenericVnf.setIsClosedLoopDisabled(false); - aaiNqGenericVnf.setModelInvariantId("653d2caa-7e47-4614-95b3-26c8d82755b8"); - aaiNqGenericVnf.setModelVersionId("98f410f6-4c63-447b-97d2-42508437cec0"); - aaiNqGenericVnf.setModelCustomizationId("SomeCustomizationId"); - aaiNqGenericVnf.setOperationalState("active"); - aaiNqGenericVnf.setPersonaModelId("653d2caa-7e47-4614-95b3-26c8d82755b8"); - aaiNqGenericVnf.setPersonaModelVersion("98f410f6-4c63-447b-97d2-42508437cec0"); - aaiNqGenericVnf.setProvStatus("complete"); - aaiNqGenericVnf.setResourceVersion("1505056714553"); - aaiNqGenericVnf.setServiceId("e8cb8968-5411-478b-906a-f28747de72cd"); - aaiNqGenericVnf.setVnfId("ed8b2bce-6b27-4089-992c-4a2c66024bcd"); - aaiNqGenericVnf.setVnfName("vCPEInfraVNF14a"); - aaiNqGenericVnf.setVnfName2("malumabb12"); - aaiNqGenericVnf.setVnfType("vCPEInfraService10/vCPEInfraService10 0"); - assertNotNull(aaiNqGenericVnf); - - assertEquals(true, aaiNqGenericVnf.getEncrypedAccessFlag()); - assertEquals(false, aaiNqGenericVnf.getInMaint()); - assertEquals("aa", aaiNqGenericVnf.getIpv4Loopback0Address()); - assertEquals("oamAddress", aaiNqGenericVnf.getIpv4OamAddress()); - assertEquals(false, aaiNqGenericVnf.getIsClosedLoopDisabled()); - assertEquals("653d2caa-7e47-4614-95b3-26c8d82755b8", aaiNqGenericVnf.getModelInvariantId()); - assertEquals("98f410f6-4c63-447b-97d2-42508437cec0", aaiNqGenericVnf.getModelVersionId()); - assertEquals("SomeCustomizationId", aaiNqGenericVnf.getModelCustomizationId()); - assertEquals("active", aaiNqGenericVnf.getOperationalState()); - assertEquals("653d2caa-7e47-4614-95b3-26c8d82755b8", aaiNqGenericVnf.getPersonaModelId()); - assertEquals("98f410f6-4c63-447b-97d2-42508437cec0", aaiNqGenericVnf.getPersonaModelVersion()); - assertEquals("complete", aaiNqGenericVnf.getProvStatus()); - assertEquals("1505056714553", aaiNqGenericVnf.getResourceVersion()); - assertEquals("e8cb8968-5411-478b-906a-f28747de72cd", aaiNqGenericVnf.getServiceId()); - assertEquals("ed8b2bce-6b27-4089-992c-4a2c66024bcd", aaiNqGenericVnf.getVnfId()); - assertEquals("vCPEInfraVNF14a", aaiNqGenericVnf.getVnfName()); - assertEquals("malumabb12", aaiNqGenericVnf.getVnfName2()); - assertEquals("vCPEInfraService10/vCPEInfraService10 0", aaiNqGenericVnf.getVnfType()); - } - -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqInstanceFiltersTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqInstanceFiltersTest.java deleted file mode 100644 index 1508891b4..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqInstanceFiltersTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * 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.onap.policy.aai; - -import static org.junit.Assert.assertNotNull; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -public class AaiNqInstanceFiltersTest { - - @BeforeClass - public static void setUpBeforeClass() throws Exception {} - - @AfterClass - public static void tearDownAfterClass() throws Exception {} - - @Test - public void test() { - AaiNqInstanceFilters aaiNqInstanceFilters = new AaiNqInstanceFilters(); - assertNotNull(aaiNqInstanceFilters); - - aaiNqInstanceFilters.setInstanceFilter(aaiNqInstanceFilters.getInstanceFilter());; - assertNotNull(aaiNqInstanceFilters); - assertNotNull(aaiNqInstanceFilters.getInstanceFilter()); - } - -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqInventoryResponseItemTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqInventoryResponseItemTest.java deleted file mode 100644 index 8b5265a00..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqInventoryResponseItemTest.java +++ /dev/null @@ -1,170 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertNotNull; - -import java.util.LinkedList; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import org.onap.policy.aai.util.Serialization; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class AaiNqInventoryResponseItemTest { - private static final Logger logger = LoggerFactory.getLogger(AaiNqInventoryResponseItemTest.class); - - @BeforeClass - public static void setUpBeforeClass() throws Exception {} - - @AfterClass - public static void tearDownAfterClass() throws Exception {} - - @Test - public void test() { - AaiNqInventoryResponseItem aaiNqInventoryResponseItem = new AaiNqInventoryResponseItem(); - aaiNqInventoryResponseItem.setModelName("service-instance"); - AaiNqCloudRegion aaiNqCloudRegion = new AaiNqCloudRegion(); - aaiNqCloudRegion.setCloudOwner("OWNER"); - aaiNqCloudRegion.setCloudRegionId("REGIONID"); - aaiNqCloudRegion.setCloudRegionVersion("2.5"); - aaiNqCloudRegion.setComplexName("COMPLEXNAME"); - aaiNqCloudRegion.setResourceVersion("1485365988"); - aaiNqInventoryResponseItem.setCloudRegion(aaiNqCloudRegion); - AaiNqExtraProperties aaiNqExtraProperties = new AaiNqExtraProperties(); - aaiNqExtraProperties.setExtraProperty(new LinkedList<>()); - aaiNqExtraProperties.getExtraProperty().add(new AaiNqExtraProperty("model.model-name", "generic-vnf")); - aaiNqExtraProperties.getExtraProperty().add(new AaiNqExtraProperty("model.model-type", "widget")); - aaiNqExtraProperties.getExtraProperty().add(new AaiNqExtraProperty("model.model-version", "1.0")); - aaiNqExtraProperties.getExtraProperty() - .add(new AaiNqExtraProperty("model.model-id", "acc6edd8-a8d4-4b93-afaa-0994068be14c")); - aaiNqExtraProperties.getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name-version-id", "93a6166f-b3d5-4f06-b4ba-aed48d009ad9")); - aaiNqInventoryResponseItem.setExtraProperties(aaiNqExtraProperties); - AaiNqGenericVnf aaiNqGenericVnf = new AaiNqGenericVnf(); - aaiNqGenericVnf.setVnfId("dhv-test-gvnf"); - aaiNqGenericVnf.setVnfName("dhv-test-gvnf-name"); - aaiNqGenericVnf.setVnfName2("dhv-test-gvnf-name2"); - aaiNqGenericVnf.setVnfType("SW"); - aaiNqGenericVnf.setServiceId("d7bb0a21-66f2-4e6d-87d9-9ef3ced63ae4"); - aaiNqGenericVnf.setProvStatus("PREPROV"); - aaiNqGenericVnf.setOperationalState("dhv-test-operational-state"); - aaiNqGenericVnf.setIpv4OamAddress("dhv-test-gvnf-ipv4-oam-address"); - aaiNqGenericVnf.setIpv4Loopback0Address("dhv-test-gvnfipv4-loopback0-address"); - aaiNqGenericVnf.setInMaint(false); - aaiNqGenericVnf.setIsClosedLoopDisabled(false); - aaiNqGenericVnf.setResourceVersion("1485366450"); - aaiNqGenericVnf.setEncrypedAccessFlag(true); - aaiNqGenericVnf.setPersonaModelId("acc6edd8-a8d4-4b93-afaa-0994068be14c"); - aaiNqGenericVnf.setPersonaModelVersion("1.0"); - aaiNqInventoryResponseItem.setGenericVnf(aaiNqGenericVnf); - AaiNqInventoryResponseItem serviceItem = new AaiNqInventoryResponseItem(); - serviceItem.setModelName("service-instance"); - serviceItem.setServiceInstance(new AaiNqServiceInstance()); - serviceItem.getServiceInstance().setServiceInstanceId("dhv-test-vhnfportal-service-instance-id"); - serviceItem.getServiceInstance().setServiceInstanceName("dhv-test-service-instance-name1"); - serviceItem.getServiceInstance().setPersonaModelId("82194af1-3c2c-485a-8f44-420e22a9eaa4"); - serviceItem.getServiceInstance().setPersonaModelVersion("1.0"); - serviceItem.getServiceInstance().setServiceInstanceLocationId("dhv-test-service-instance-location-id1"); - serviceItem.getServiceInstance().setResourceVersion("1485366092"); - serviceItem.setExtraProperties(new AaiNqExtraProperties()); - serviceItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name", "service-instance")); - serviceItem.getExtraProperties().getExtraProperty().add(new AaiNqExtraProperty("model.model-type", "widget")); - serviceItem.getExtraProperties().getExtraProperty().add(new AaiNqExtraProperty("model.model-version", "1.0")); - serviceItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-id", "82194af1-3c2c-485a-8f44-420e22a9eaa4")); - serviceItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name", "46b92144-923a-4d20-b85a-3cbd847668a9")); - - AaiNqInventoryResponseItem vfModuleItem = new AaiNqInventoryResponseItem(); - vfModuleItem.setModelName("vf-module"); - vfModuleItem.setVfModule(new AaiNqVfModule()); - vfModuleItem.getVfModule().setVfModuleId("example-vf-module-id-val-49261"); - vfModuleItem.getVfModule().setVfModuleName("example-vf-module-name-val-73074"); - vfModuleItem.getVfModule().setHeatStackId("example-heat-stack-id-val-86300"); - vfModuleItem.getVfModule().setOrchestrationStatus("example-orchestration-status-val-56523"); - vfModuleItem.getVfModule().setIsBaseVfModule(true); - vfModuleItem.getVfModule().setResourceVersion("1485366450"); - vfModuleItem.getVfModule().setPersonaModelId("ef86f9c5-2165-44f3-8fc3-96018b609ea5"); - vfModuleItem.getVfModule().setPersonaModelVersion("1.0"); - vfModuleItem.getVfModule().setWidgetModelId("example-widget-model-id-val-92571"); - vfModuleItem.getVfModule().setWidgetModelVersion("example-widget-model-version-val-83317"); - vfModuleItem.getVfModule().setContrailServiceInstanceFqdn("example-contrail-service-instance-fqdn-val-86796"); - vfModuleItem.setExtraProperties(new AaiNqExtraProperties()); - vfModuleItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name", "vf-module")); - vfModuleItem.getExtraProperties().getExtraProperty().add(new AaiNqExtraProperty("model.model-type", "widget")); - vfModuleItem.getExtraProperties().getExtraProperty().add(new AaiNqExtraProperty("model.model-version", "1.0")); - vfModuleItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-id", "ef86f9c5-2165-44f3-8fc3-96018b609ea5")); - vfModuleItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name", "c00563ae-812b-4e62-8330-7c4d0f47088a")); - - AaiNqInventoryResponseItems aaiNqInventoryResponseItems = new AaiNqInventoryResponseItems(); - aaiNqInventoryResponseItems.getInventoryResponseItems().add(serviceItem); - aaiNqInventoryResponseItems.getInventoryResponseItems().add(vfModuleItem); - aaiNqInventoryResponseItem.setItems(aaiNqInventoryResponseItems); - aaiNqInventoryResponseItem.setModelName("model-name"); - AaiNqServiceInstance serviceInstance = new AaiNqServiceInstance(); - serviceInstance.setServiceInstanceId("dhv-test-vhnfportal-service-instance-id"); - serviceInstance.setServiceInstanceName("dhv-test-service-instance-name1"); - serviceInstance.setPersonaModelId("82194af1-3c2c-485a-8f44-420e22a9eaa4"); - serviceInstance.setPersonaModelVersion("1.0"); - serviceInstance.setServiceInstanceLocationId("dhv-test-service-instance-location-id1"); - serviceInstance.setResourceVersion("1485366092"); - aaiNqInventoryResponseItem.setServiceInstance(serviceInstance); - AaiNqTenant aaiNqTenant = new AaiNqTenant(); - aaiNqTenant.setTenantId("dhv-test-tenant"); - aaiNqTenant.setTenantName("dhv-test-tenant-name"); - aaiNqTenant.setResourceVersion("1485366334"); - aaiNqInventoryResponseItem.setTenant(aaiNqTenant); - AaiNqVfModule aaiNqVfModule = new AaiNqVfModule(); - aaiNqVfModule.setVfModuleId("example-vf-module-id-val-49261"); - aaiNqVfModule.setVfModuleName("example-vf-module-name-val-73074"); - aaiNqVfModule.setHeatStackId("example-heat-stack-id-val-86300"); - aaiNqVfModule.setOrchestrationStatus("example-orchestration-status-val-56523"); - aaiNqVfModule.setIsBaseVfModule(true); - aaiNqVfModule.setResourceVersion("1485366450"); - aaiNqVfModule.setPersonaModelId("ef86f9c5-2165-44f3-8fc3-96018b609ea5"); - aaiNqVfModule.setPersonaModelVersion("1.0"); - aaiNqVfModule.setWidgetModelId("example-widget-model-id-val-92571"); - aaiNqVfModule.setWidgetModelVersion("example-widget-model-version-val-83317"); - aaiNqVfModule.setContrailServiceInstanceFqdn("example-contrail-service-instance-fqdn-val-86796"); - aaiNqInventoryResponseItem.setVfModule(aaiNqVfModule); - AaiNqVServer aaiNqVServer = new AaiNqVServer(); - aaiNqVServer.setVserverId("dhv-test-vserver"); - aaiNqVServer.setVserverName("dhv-test-vserver-name"); - aaiNqVServer.setVserverName2("dhv-test-vserver-name2"); - aaiNqVServer.setProvStatus("PREPROV"); - aaiNqVServer.setVserverSelflink("dhv-test-vserver-selflink"); - aaiNqVServer.setInMaint(false); - aaiNqVServer.setIsClosedLoopDisabled(false); - aaiNqVServer.setResourceVersion("1485366417"); - aaiNqInventoryResponseItem.setVserver(aaiNqVServer); - assertNotNull(aaiNqInventoryResponseItem); - - logger.info(Serialization.gsonPretty.toJson(aaiNqInventoryResponseItem)); - } - -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqInventoryResponseItemsTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqInventoryResponseItemsTest.java deleted file mode 100644 index 99c6e5e92..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqInventoryResponseItemsTest.java +++ /dev/null @@ -1,163 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * 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.onap.policy.aai; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import java.util.LinkedList; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import org.onap.policy.aai.util.Serialization; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class AaiNqInventoryResponseItemsTest { - private static final Logger logger = LoggerFactory.getLogger(AaiNqInventoryResponseItemsTest.class); - - @BeforeClass - public static void setUpBeforeClass() throws Exception {} - - @AfterClass - public static void tearDownAfterClass() throws Exception {} - - @Test - public void test() { - AaiNqInventoryResponseItem serviceItem = new AaiNqInventoryResponseItem(); - serviceItem.setModelName("service-instance"); - assertEquals("service-instance", serviceItem.getModelName()); - - serviceItem.setServiceInstance(new AaiNqServiceInstance()); - serviceItem.getServiceInstance().setServiceInstanceId("dhv-test-vhnfportal-service-instance-id"); - serviceItem.getServiceInstance().setServiceInstanceName("dhv-test-service-instance-name1"); - serviceItem.getServiceInstance().setPersonaModelId("82194af1-3c2c-485a-8f44-420e22a9eaa4"); - serviceItem.getServiceInstance().setPersonaModelVersion("1.0"); - serviceItem.getServiceInstance().setServiceInstanceLocationId("dhv-test-service-instance-location-id1"); - serviceItem.getServiceInstance().setResourceVersion("1485366092"); - serviceItem.setExtraProperties(new AaiNqExtraProperties()); - serviceItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name", "service-instance")); - serviceItem.getExtraProperties().getExtraProperty().add(new AaiNqExtraProperty("model.model-type", "widget")); - serviceItem.getExtraProperties().getExtraProperty().add(new AaiNqExtraProperty("model.model-version", "1.0")); - serviceItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-id", "82194af1-3c2c-485a-8f44-420e22a9eaa4")); - serviceItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name", "46b92144-923a-4d20-b85a-3cbd847668a9")); - - AaiNqInventoryResponseItem vfModuleItem = new AaiNqInventoryResponseItem(); - vfModuleItem.setModelName("vf-module"); - vfModuleItem.setVfModule(new AaiNqVfModule()); - vfModuleItem.getVfModule().setVfModuleId("example-vf-module-id-val-49261"); - vfModuleItem.getVfModule().setVfModuleName("example-vf-module-name-val-73074"); - vfModuleItem.getVfModule().setHeatStackId("example-heat-stack-id-val-86300"); - vfModuleItem.getVfModule().setOrchestrationStatus("example-orchestration-status-val-56523"); - vfModuleItem.getVfModule().setIsBaseVfModule(true); - vfModuleItem.getVfModule().setResourceVersion("1485366450"); - vfModuleItem.getVfModule().setPersonaModelId("ef86f9c5-2165-44f3-8fc3-96018b609ea5"); - vfModuleItem.getVfModule().setPersonaModelVersion("1.0"); - vfModuleItem.getVfModule().setWidgetModelId("example-widget-model-id-val-92571"); - vfModuleItem.getVfModule().setWidgetModelVersion("example-widget-model-version-val-83317"); - vfModuleItem.getVfModule().setContrailServiceInstanceFqdn("example-contrail-service-instance-fqdn-val-86796"); - vfModuleItem.setExtraProperties(new AaiNqExtraProperties()); - vfModuleItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name", "vf-module")); - vfModuleItem.getExtraProperties().getExtraProperty().add(new AaiNqExtraProperty("model.model-type", "widget")); - vfModuleItem.getExtraProperties().getExtraProperty().add(new AaiNqExtraProperty("model.model-version", "1.0")); - vfModuleItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-id", "ef86f9c5-2165-44f3-8fc3-96018b609ea5")); - vfModuleItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name", "c00563ae-812b-4e62-8330-7c4d0f47088a")); - - AaiNqInventoryResponseItem genericVnfItem = new AaiNqInventoryResponseItem(); - genericVnfItem.setModelName("generic-vnf"); - genericVnfItem.setGenericVnf(new AaiNqGenericVnf()); - genericVnfItem.getGenericVnf().setVnfId("dhv-test-gvnf"); - genericVnfItem.getGenericVnf().setVnfName("dhv-test-gvnf-name"); - genericVnfItem.getGenericVnf().setVnfName2("dhv-test-gvnf-name2"); - genericVnfItem.getGenericVnf().setVnfType("SW"); - genericVnfItem.getGenericVnf().setServiceId("d7bb0a21-66f2-4e6d-87d9-9ef3ced63ae4"); - genericVnfItem.getGenericVnf().setProvStatus("PREPROV"); - genericVnfItem.getGenericVnf().setOperationalState("dhv-test-operational-state"); - genericVnfItem.getGenericVnf().setIpv4OamAddress("dhv-test-gvnf-ipv4-oam-address"); - genericVnfItem.getGenericVnf().setIpv4Loopback0Address("dhv-test-gvnfipv4-loopback0-address"); - genericVnfItem.getGenericVnf().setInMaint(false); - genericVnfItem.getGenericVnf().setIsClosedLoopDisabled(false); - genericVnfItem.getGenericVnf().setResourceVersion("1485366450"); - genericVnfItem.getGenericVnf().setEncrypedAccessFlag(true); - genericVnfItem.getGenericVnf().setPersonaModelId("acc6edd8-a8d4-4b93-afaa-0994068be14c"); - genericVnfItem.getGenericVnf().setPersonaModelVersion("1.0"); - genericVnfItem.setExtraProperties(new AaiNqExtraProperties()); - genericVnfItem.getExtraProperties().setExtraProperty(new LinkedList<>()); - genericVnfItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name", "generic-vnf")); - genericVnfItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-type", "widget")); - genericVnfItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-version", "1.0")); - genericVnfItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-id", "acc6edd8-a8d4-4b93-afaa-0994068be14c")); - genericVnfItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name-version-id", "93a6166f-b3d5-4f06-b4ba-aed48d009ad9")); - genericVnfItem.setItems(new AaiNqInventoryResponseItems()); - genericVnfItem.getItems().setInventoryResponseItems(new LinkedList<>()); - genericVnfItem.getItems().getInventoryResponseItems().add(serviceItem); - genericVnfItem.getItems().getInventoryResponseItems().add(vfModuleItem); - - AaiNqInventoryResponseItem cloudItem = new AaiNqInventoryResponseItem(); - cloudItem.setCloudRegion(new AaiNqCloudRegion()); - cloudItem.getCloudRegion().setCloudOwner("OWNER"); - cloudItem.getCloudRegion().setCloudRegionId("REGIONID"); - cloudItem.getCloudRegion().setCloudRegionVersion("2.5"); - cloudItem.getCloudRegion().setComplexName("COMPLEXNAME"); - cloudItem.getCloudRegion().setResourceVersion("1485365988"); - - AaiNqInventoryResponseItem tenantItem = new AaiNqInventoryResponseItem(); - tenantItem.setTenant(new AaiNqTenant()); - tenantItem.getTenant().setTenantId("dhv-test-tenant"); - tenantItem.getTenant().setTenantName("dhv-test-tenant-name"); - tenantItem.getTenant().setResourceVersion("1485366334"); - tenantItem.setItems(new AaiNqInventoryResponseItems()); - tenantItem.getItems().setInventoryResponseItems(new LinkedList<>()); - tenantItem.getItems().getInventoryResponseItems().add(cloudItem); - AaiNqInventoryResponseItem vserverItem = new AaiNqInventoryResponseItem(); - vserverItem.setVserver(new AaiNqVServer()); - vserverItem.getVserver().setVserverId("dhv-test-vserver"); - vserverItem.getVserver().setVserverName("dhv-test-vserver-name"); - vserverItem.getVserver().setVserverName2("dhv-test-vserver-name2"); - vserverItem.getVserver().setProvStatus("PREPROV"); - vserverItem.getVserver().setVserverSelflink("dhv-test-vserver-selflink"); - vserverItem.getVserver().setInMaint(false); - vserverItem.getVserver().setIsClosedLoopDisabled(false); - vserverItem.getVserver().setResourceVersion("1485366417"); - vserverItem.setItems(new AaiNqInventoryResponseItems()); - vserverItem.getItems().setInventoryResponseItems(new LinkedList<>()); - vserverItem.getItems().getInventoryResponseItems().add(genericVnfItem); - vserverItem.getItems().getInventoryResponseItems().add(tenantItem); - - AaiNqInventoryResponseItems aaiNqInventoryResponseItems = new AaiNqInventoryResponseItems(); - aaiNqInventoryResponseItems.getInventoryResponseItems().add(vserverItem); - assertNotNull(aaiNqInventoryResponseItems); - logger.info(Serialization.gsonPretty.toJson(aaiNqInventoryResponseItems)); - } - -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqNamedQueryTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqNamedQueryTest.java deleted file mode 100644 index 2e65a843d..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqNamedQueryTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import java.util.UUID; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -public class AaiNqNamedQueryTest { - - @BeforeClass - public static void setUpBeforeClass() throws Exception {} - - @AfterClass - public static void tearDownAfterClass() throws Exception {} - - @Test - public void test() { - AaiNqNamedQuery aaiNqNamedQuery = new AaiNqNamedQuery(); - UUID uuid = UUID.randomUUID(); - aaiNqNamedQuery.setNamedQueryUuid(uuid); - assertNotNull(aaiNqNamedQuery); - assertEquals(aaiNqNamedQuery.getNamedQueryUuid(), uuid); - } -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqQueryParametersTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqQueryParametersTest.java deleted file mode 100644 index 1f0a8354a..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqQueryParametersTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import java.util.UUID; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -public class AaiNqQueryParametersTest { - - @BeforeClass - public static void setUpBeforeClass() throws Exception {} - - @AfterClass - public static void tearDownAfterClass() throws Exception {} - - @Test - public void test() { - AaiNqQueryParameters aaiNqQueryParameters = new AaiNqQueryParameters(); - AaiNqNamedQuery aaiNqNamedQuery = new AaiNqNamedQuery(); - aaiNqNamedQuery.setNamedQueryUuid(UUID.randomUUID()); - aaiNqQueryParameters.setNamedQuery(aaiNqNamedQuery); - assertNotNull(aaiNqNamedQuery); - assertEquals(aaiNqQueryParameters.getNamedQuery(), aaiNqNamedQuery); - } - -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqRequestErrorTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqRequestErrorTest.java deleted file mode 100644 index e943c0c01..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqRequestErrorTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; - -import org.junit.Test; - -public class AaiNqRequestErrorTest { - - @Test - public void test() { - AaiNqRequestError aainqRequestError = new AaiNqRequestError(); - AaiNqServiceExcept serviceExcept = new AaiNqServiceExcept(); - aainqRequestError.setServiceExcept(serviceExcept); - assertEquals(aainqRequestError.getServiceExcept(), serviceExcept); - - assertNull(serviceExcept.getMessageId()); - assertNull(serviceExcept.getText()); - assertNull(serviceExcept.getVariables()); - } -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqRequestTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqRequestTest.java deleted file mode 100644 index 1ac5e457b..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqRequestTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import java.util.UUID; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import org.onap.policy.aai.util.Serialization; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class AaiNqRequestTest { - private static final Logger logger = LoggerFactory.getLogger(AaiNqRequestTest.class); - - @BeforeClass - public static void setUpBeforeClass() throws Exception {} - - @AfterClass - public static void tearDownAfterClass() throws Exception {} - - @Test - public void test() { - AaiNqRequest aaiNqRequest = new AaiNqRequest(); - AaiNqInstanceFilters aaiNqInstanceFilters = new AaiNqInstanceFilters(); - - aaiNqRequest.setInstanceFilters(aaiNqInstanceFilters); - assertNotNull(aaiNqRequest.getInstanceFilters()); - AaiNqNamedQuery aaiNqNamedQuery = new AaiNqNamedQuery(); - UUID uuid = UUID.randomUUID(); - aaiNqNamedQuery.setNamedQueryUuid(uuid); - - AaiNqQueryParameters aaiNqQueryParameters = new AaiNqQueryParameters(); - aaiNqQueryParameters.setNamedQuery(aaiNqNamedQuery); - aaiNqRequest.setQueryParameters(aaiNqQueryParameters); - - assertNotNull(aaiNqRequest); - - assertEquals(aaiNqNamedQuery.getNamedQueryUuid(), uuid); - assertEquals(aaiNqQueryParameters.getNamedQuery(), aaiNqNamedQuery); - assertEquals(aaiNqRequest.getQueryParameters(), aaiNqQueryParameters); - - logger.info(Serialization.gsonPretty.toJson(aaiNqRequest)); - } - -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqResponseTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqResponseTest.java deleted file mode 100644 index c715a22c2..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqResponseTest.java +++ /dev/null @@ -1,160 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import java.util.LinkedList; - -import org.junit.Test; -import org.onap.policy.aai.util.Serialization; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class AaiNqResponseTest { - private static final Logger logger = LoggerFactory.getLogger(AaiNqResponseTest.class); - - @Test - public void test() { - getAaiNqResponse(); - } - - /** - * Get A&AI NQ response. - * - * @return the A&AI NG response - */ - public AaiNqResponse getAaiNqResponse() { - AaiNqInventoryResponseItem serviceItem = new AaiNqInventoryResponseItem(); - serviceItem.setModelName("service-instance"); - serviceItem.setServiceInstance(new AaiNqServiceInstance()); - serviceItem.getServiceInstance().setServiceInstanceId("dhv-test-vhnfportal-service-instance-id"); - serviceItem.getServiceInstance().setServiceInstanceName("dhv-test-service-instance-name1"); - serviceItem.getServiceInstance().setPersonaModelId("82194af1-3c2c-485a-8f44-420e22a9eaa4"); - serviceItem.getServiceInstance().setPersonaModelVersion("1.0"); - serviceItem.getServiceInstance().setServiceInstanceLocationId("dhv-test-service-instance-location-id1"); - serviceItem.getServiceInstance().setResourceVersion("1485366092"); - serviceItem.setExtraProperties(new AaiNqExtraProperties()); - serviceItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name", "service-instance")); - serviceItem.getExtraProperties().getExtraProperty().add(new AaiNqExtraProperty("model.model-type", "widget")); - serviceItem.getExtraProperties().getExtraProperty().add(new AaiNqExtraProperty("model.model-version", "1.0")); - serviceItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-id", "82194af1-3c2c-485a-8f44-420e22a9eaa4")); - serviceItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name", "46b92144-923a-4d20-b85a-3cbd847668a9")); - - AaiNqInventoryResponseItem vfModuleItem = new AaiNqInventoryResponseItem(); - vfModuleItem.setModelName("vf-module"); - vfModuleItem.setVfModule(new AaiNqVfModule()); - vfModuleItem.getVfModule().setVfModuleId("example-vf-module-id-val-49261"); - vfModuleItem.getVfModule().setVfModuleName("example-vf-module-name-val-73074"); - vfModuleItem.getVfModule().setHeatStackId("example-heat-stack-id-val-86300"); - vfModuleItem.getVfModule().setOrchestrationStatus("example-orchestration-status-val-56523"); - vfModuleItem.getVfModule().setIsBaseVfModule(true); - vfModuleItem.getVfModule().setResourceVersion("1485366450"); - vfModuleItem.getVfModule().setPersonaModelId("ef86f9c5-2165-44f3-8fc3-96018b609ea5"); - vfModuleItem.getVfModule().setPersonaModelVersion("1.0"); - vfModuleItem.getVfModule().setWidgetModelId("example-widget-model-id-val-92571"); - vfModuleItem.getVfModule().setWidgetModelVersion("example-widget-model-version-val-83317"); - vfModuleItem.getVfModule().setContrailServiceInstanceFqdn("example-contrail-service-instance-fqdn-val-86796"); - vfModuleItem.setExtraProperties(new AaiNqExtraProperties()); - vfModuleItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name", "vf-module")); - vfModuleItem.getExtraProperties().getExtraProperty().add(new AaiNqExtraProperty("model.model-type", "widget")); - vfModuleItem.getExtraProperties().getExtraProperty().add(new AaiNqExtraProperty("model.model-version", "1.0")); - vfModuleItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-id", "ef86f9c5-2165-44f3-8fc3-96018b609ea5")); - vfModuleItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name", "c00563ae-812b-4e62-8330-7c4d0f47088a")); - - AaiNqInventoryResponseItem genericVnfItem = new AaiNqInventoryResponseItem(); - genericVnfItem.setModelName("generic-vnf"); - genericVnfItem.setGenericVnf(new AaiNqGenericVnf()); - genericVnfItem.getGenericVnf().setVnfId("dhv-test-gvnf"); - genericVnfItem.getGenericVnf().setVnfName("dhv-test-gvnf-name"); - genericVnfItem.getGenericVnf().setVnfName2("dhv-test-gvnf-name2"); - genericVnfItem.getGenericVnf().setVnfType("SW"); - genericVnfItem.getGenericVnf().setServiceId("d7bb0a21-66f2-4e6d-87d9-9ef3ced63ae4"); - genericVnfItem.getGenericVnf().setProvStatus("PREPROV"); - genericVnfItem.getGenericVnf().setOperationalState("dhv-test-operational-state"); - genericVnfItem.getGenericVnf().setIpv4OamAddress("dhv-test-gvnf-ipv4-oam-address"); - genericVnfItem.getGenericVnf().setIpv4Loopback0Address("dhv-test-gvnfipv4-loopback0-address"); - genericVnfItem.getGenericVnf().setInMaint(false); - genericVnfItem.getGenericVnf().setIsClosedLoopDisabled(false); - genericVnfItem.getGenericVnf().setResourceVersion("1485366450"); - genericVnfItem.getGenericVnf().setEncrypedAccessFlag(true); - genericVnfItem.getGenericVnf().setPersonaModelId("acc6edd8-a8d4-4b93-afaa-0994068be14c"); - genericVnfItem.getGenericVnf().setPersonaModelVersion("1.0"); - genericVnfItem.setExtraProperties(new AaiNqExtraProperties()); - genericVnfItem.getExtraProperties().setExtraProperty(new LinkedList<>()); - genericVnfItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name", "generic-vnf")); - genericVnfItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-type", "widget")); - genericVnfItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-version", "1.0")); - genericVnfItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-id", "acc6edd8-a8d4-4b93-afaa-0994068be14c")); - genericVnfItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name-version-id", "93a6166f-b3d5-4f06-b4ba-aed48d009ad9")); - genericVnfItem.setItems(new AaiNqInventoryResponseItems()); - genericVnfItem.getItems().setInventoryResponseItems(new LinkedList<>()); - genericVnfItem.getItems().getInventoryResponseItems().add(serviceItem); - genericVnfItem.getItems().getInventoryResponseItems().add(vfModuleItem); - - AaiNqInventoryResponseItem cloudItem = new AaiNqInventoryResponseItem(); - cloudItem.setCloudRegion(new AaiNqCloudRegion()); - cloudItem.getCloudRegion().setCloudOwner("OWNER"); - cloudItem.getCloudRegion().setCloudRegionId("REGIONID"); - cloudItem.getCloudRegion().setCloudRegionVersion("2.5"); - cloudItem.getCloudRegion().setComplexName("COMPLEXNAME"); - cloudItem.getCloudRegion().setResourceVersion("1485365988"); - - AaiNqInventoryResponseItem tenantItem = new AaiNqInventoryResponseItem(); - tenantItem.setTenant(new AaiNqTenant()); - tenantItem.getTenant().setTenantId("dhv-test-tenant"); - tenantItem.getTenant().setTenantName("dhv-test-tenant-name"); - tenantItem.getTenant().setResourceVersion("1485366334"); - tenantItem.setItems(new AaiNqInventoryResponseItems()); - tenantItem.getItems().setInventoryResponseItems(new LinkedList<>()); - tenantItem.getItems().getInventoryResponseItems().add(cloudItem); - - AaiNqInventoryResponseItem vserverItem = new AaiNqInventoryResponseItem(); - vserverItem.setVserver(new AaiNqVServer()); - vserverItem.getVserver().setVserverId("dhv-test-vserver"); - vserverItem.getVserver().setVserverName("dhv-test-vserver-name"); - vserverItem.getVserver().setVserverName2("dhv-test-vserver-name2"); - vserverItem.getVserver().setProvStatus("PREPROV"); - vserverItem.getVserver().setVserverSelflink("dhv-test-vserver-selflink"); - vserverItem.getVserver().setInMaint(false); - vserverItem.getVserver().setIsClosedLoopDisabled(false); - vserverItem.getVserver().setResourceVersion("1485366417"); - vserverItem.setItems(new AaiNqInventoryResponseItems()); - vserverItem.getItems().setInventoryResponseItems(new LinkedList<>()); - vserverItem.getItems().getInventoryResponseItems().add(genericVnfItem); - vserverItem.getItems().getInventoryResponseItems().add(tenantItem); - - AaiNqResponse aaiResponse = new AaiNqResponse(); - aaiResponse.getInventoryResponseItems().add(vserverItem); - logger.info(Serialization.gsonPretty.toJson(aaiResponse)); - - return aaiResponse; - } -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqResponseWrapperTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqResponseWrapperTest.java deleted file mode 100644 index d1e8e964e..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqResponseWrapperTest.java +++ /dev/null @@ -1,261 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.LinkedList; -import java.util.List; -import java.util.UUID; -import org.apache.commons.io.IOUtils; -import org.junit.Test; -import org.onap.policy.aai.util.Serialization; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class AaiNqResponseWrapperTest { - private static final Logger logger = LoggerFactory.getLogger(AaiNqResponseWrapperTest.class); - - @Test - public void test() { - AaiNqInventoryResponseItem serviceItem = new AaiNqInventoryResponseItem(); - serviceItem.setModelName("service-instance"); - serviceItem.setServiceInstance(new AaiNqServiceInstance()); - serviceItem.getServiceInstance().setServiceInstanceId("dhv-test-vhnfportal-service-instance-id"); - serviceItem.getServiceInstance().setServiceInstanceName("dhv-test-service-instance-name1"); - serviceItem.getServiceInstance().setPersonaModelId("82194af1-3c2c-485a-8f44-420e22a9eaa4"); - serviceItem.getServiceInstance().setPersonaModelVersion("1.0"); - serviceItem.getServiceInstance().setServiceInstanceLocationId("dhv-test-service-instance-location-id1"); - serviceItem.getServiceInstance().setResourceVersion("1485366092"); - serviceItem.setExtraProperties(new AaiNqExtraProperties()); - serviceItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name", "service-instance")); - serviceItem.getExtraProperties().getExtraProperty().add(new AaiNqExtraProperty("model.model-type", "widget")); - serviceItem.getExtraProperties().getExtraProperty().add(new AaiNqExtraProperty("model.model-version", "1.0")); - serviceItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-id", "82194af1-3c2c-485a-8f44-420e22a9eaa4")); - serviceItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name", "46b92144-923a-4d20-b85a-3cbd847668a9")); - - AaiNqInventoryResponseItem vfModuleItem = new AaiNqInventoryResponseItem(); - vfModuleItem.setModelName("vf-module"); - vfModuleItem.setVfModule(new AaiNqVfModule()); - vfModuleItem.getVfModule().setVfModuleId("example-vf-module-id-val-49261"); - vfModuleItem.getVfModule().setVfModuleName("example-vf-module-name-val-73074"); - vfModuleItem.getVfModule().setHeatStackId("example-heat-stack-id-val-86300"); - vfModuleItem.getVfModule().setOrchestrationStatus("example-orchestration-status-val-56523"); - vfModuleItem.getVfModule().setIsBaseVfModule(true); - vfModuleItem.getVfModule().setResourceVersion("1485366450"); - vfModuleItem.getVfModule().setPersonaModelId("ef86f9c5-2165-44f3-8fc3-96018b609ea5"); - vfModuleItem.getVfModule().setPersonaModelVersion("1.0"); - vfModuleItem.getVfModule().setWidgetModelId("example-widget-model-id-val-92571"); - vfModuleItem.getVfModule().setWidgetModelVersion("example-widget-model-version-val-83317"); - vfModuleItem.getVfModule().setContrailServiceInstanceFqdn("example-contrail-service-instance-fqdn-val-86796"); - vfModuleItem.setExtraProperties(new AaiNqExtraProperties()); - vfModuleItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name", "vf-module")); - vfModuleItem.getExtraProperties().getExtraProperty().add(new AaiNqExtraProperty("model.model-type", "widget")); - vfModuleItem.getExtraProperties().getExtraProperty().add(new AaiNqExtraProperty("model.model-version", "1.0")); - vfModuleItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-id", "ef86f9c5-2165-44f3-8fc3-96018b609ea5")); - vfModuleItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name", "c00563ae-812b-4e62-8330-7c4d0f47088a")); - - AaiNqInventoryResponseItem genericVnfItem = new AaiNqInventoryResponseItem(); - genericVnfItem.setModelName("generic-vnf"); - genericVnfItem.setGenericVnf(new AaiNqGenericVnf()); - genericVnfItem.getGenericVnf().setVnfId("dhv-test-gvnf"); - genericVnfItem.getGenericVnf().setVnfName("dhv-test-gvnf-name"); - genericVnfItem.getGenericVnf().setVnfName2("dhv-test-gvnf-name2"); - genericVnfItem.getGenericVnf().setVnfType("SW"); - genericVnfItem.getGenericVnf().setServiceId("d7bb0a21-66f2-4e6d-87d9-9ef3ced63ae4"); - genericVnfItem.getGenericVnf().setProvStatus("PREPROV"); - genericVnfItem.getGenericVnf().setOperationalState("dhv-test-operational-state"); - genericVnfItem.getGenericVnf().setIpv4OamAddress("dhv-test-gvnf-ipv4-oam-address"); - genericVnfItem.getGenericVnf().setIpv4Loopback0Address("dhv-test-gvnfipv4-loopback0-address"); - genericVnfItem.getGenericVnf().setInMaint(false); - genericVnfItem.getGenericVnf().setIsClosedLoopDisabled(false); - genericVnfItem.getGenericVnf().setResourceVersion("1485366450"); - genericVnfItem.getGenericVnf().setEncrypedAccessFlag(true); - genericVnfItem.getGenericVnf().setPersonaModelId("acc6edd8-a8d4-4b93-afaa-0994068be14c"); - genericVnfItem.getGenericVnf().setPersonaModelVersion("1.0"); - genericVnfItem.setExtraProperties(new AaiNqExtraProperties()); - genericVnfItem.getExtraProperties().setExtraProperty(new LinkedList<>()); - genericVnfItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name", "generic-vnf")); - genericVnfItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-type", "widget")); - genericVnfItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-version", "1.0")); - genericVnfItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-id", "acc6edd8-a8d4-4b93-afaa-0994068be14c")); - genericVnfItem.getExtraProperties().getExtraProperty() - .add(new AaiNqExtraProperty("model.model-name-version-id", "93a6166f-b3d5-4f06-b4ba-aed48d009ad9")); - genericVnfItem.setItems(new AaiNqInventoryResponseItems()); - genericVnfItem.getItems().setInventoryResponseItems(new LinkedList<>()); - genericVnfItem.getItems().getInventoryResponseItems().add(serviceItem); - genericVnfItem.getItems().getInventoryResponseItems().add(vfModuleItem); - - AaiNqInventoryResponseItem cloudItem = new AaiNqInventoryResponseItem(); - cloudItem.setCloudRegion(new AaiNqCloudRegion()); - cloudItem.getCloudRegion().setCloudOwner("OWNER"); - cloudItem.getCloudRegion().setCloudRegionId("REGIONID"); - cloudItem.getCloudRegion().setCloudRegionVersion("2.5"); - cloudItem.getCloudRegion().setComplexName("COMPLEXNAME"); - cloudItem.getCloudRegion().setResourceVersion("1485365988"); - - AaiNqInventoryResponseItem tenantItem = new AaiNqInventoryResponseItem(); - tenantItem.setTenant(new AaiNqTenant()); - tenantItem.getTenant().setTenantId("dhv-test-tenant"); - tenantItem.getTenant().setTenantName("dhv-test-tenant-name"); - tenantItem.getTenant().setResourceVersion("1485366334"); - tenantItem.setItems(new AaiNqInventoryResponseItems()); - tenantItem.getItems().setInventoryResponseItems(new LinkedList<>()); - tenantItem.getItems().getInventoryResponseItems().add(cloudItem); - - AaiNqInventoryResponseItem vserverItem = new AaiNqInventoryResponseItem(); - vserverItem.setVserver(new AaiNqVServer()); - vserverItem.getVserver().setVserverId("dhv-test-vserver"); - vserverItem.getVserver().setVserverName("dhv-test-vserver-name"); - vserverItem.getVserver().setVserverName2("dhv-test-vserver-name2"); - vserverItem.getVserver().setProvStatus("PREPROV"); - vserverItem.getVserver().setVserverSelflink("dhv-test-vserver-selflink"); - vserverItem.getVserver().setInMaint(false); - vserverItem.getVserver().setIsClosedLoopDisabled(false); - vserverItem.getVserver().setResourceVersion("1485366417"); - vserverItem.setItems(new AaiNqInventoryResponseItems()); - vserverItem.getItems().setInventoryResponseItems(new LinkedList<>()); - vserverItem.getItems().getInventoryResponseItems().add(genericVnfItem); - vserverItem.getItems().getInventoryResponseItems().add(tenantItem); - - AaiNqResponse aaiResponse = new AaiNqResponse(); - aaiResponse.getInventoryResponseItems().add(vserverItem); - AaiNqResponseWrapper aaiNqResponseWarapper = new AaiNqResponseWrapper(); - aaiNqResponseWarapper.setAaiNqResponse(aaiResponse); - aaiNqResponseWarapper.setRequestId(UUID.randomUUID()); - assertNotNull(aaiNqResponseWarapper); - logger.info(Serialization.gsonPretty.toJson(aaiNqResponseWarapper)); - - AaiNqResponse aaiResponse2 = new AaiNqResponse(); - aaiResponse2.getInventoryResponseItems().add(vserverItem); - AaiNqResponseWrapper aaiNqResponseWarapper2 = new AaiNqResponseWrapper(UUID.randomUUID(), aaiResponse); - assertNotNull(aaiNqResponseWarapper2); - assertNotNull(aaiNqResponseWarapper2.getRequestId()); - assertNotNull(aaiNqResponseWarapper2.getAaiNqResponse()); - logger.info(Serialization.gsonPretty.toJson(aaiNqResponseWarapper2)); - } - - @Test - public void testCountVfModules() throws Exception { - AaiNqResponseWrapper resp; - - // null item - resp = new AaiNqResponseWrapper(); - assertEquals(0, resp.countVfModules()); - - // no names - resp.setAaiNqResponse(load("AaiNqResponseWrapper-NoNames.json")); - assertEquals(0, resp.countVfModules()); - - // has VF modules - resp.setAaiNqResponse(load("AaiNqResponseWrapper-Vserver.json")); - assertEquals(3, resp.countVfModules()); - } - - @Test - public void testGenVfModuleName() throws Exception { - AaiNqResponseWrapper resp; - - // null item - resp = new AaiNqResponseWrapper(); - assertEquals(null, resp.genVfModuleName()); - - // no names - resp.setAaiNqResponse(load("AaiNqResponseWrapper-NoNames.json")); - assertEquals(null, resp.genVfModuleName()); - - // has VF modules - resp.setAaiNqResponse(load("AaiNqResponseWrapper-Vserver.json")); - assertEquals("my-module-abc_124", resp.genVfModuleName()); - } - - @Test - public void testGetVfModules() throws Exception { - AaiNqResponseWrapper resp; - - // null item - resp = new AaiNqResponseWrapper(); - assertTrue(resp.getVfModuleItems(true).isEmpty()); - - // missing item - resp = new AaiNqResponseWrapper(); - resp.setAaiNqResponse(new AaiNqResponse()); - assertTrue(resp.getVfModuleItems(false).isEmpty()); - - // null item list - resp.setAaiNqResponse(load("AaiNqResponseWrapper-NoItems.json")); - resp.getAaiNqResponse().getInventoryResponseItems().get(0).getItems().getInventoryResponseItems().get(0) - .getItems().setInventoryResponseItems(null); - assertTrue(resp.getVfModuleItems(false).isEmpty()); - - // no modules - resp.setAaiNqResponse(load("AaiNqResponseWrapper-NoModules.json")); - assertTrue(resp.getVfModuleItems(false).isEmpty()); - - // no names - resp.setAaiNqResponse(load("AaiNqResponseWrapper-NoNames.json")); - List lst; - lst = resp.getVfModuleItems(false); - assertEquals(0, lst.size()); - - // base VF modules - resp.setAaiNqResponse(load("AaiNqResponseWrapper-Vserver.json")); - lst = resp.getVfModuleItems(true); - assertEquals(1, lst.size()); - assertEquals("Vfmodule_vLBMS-0809-1", lst.get(0).getVfModule().getVfModuleName()); - - // non base VF modules - resp.setAaiNqResponse(load("AaiNqResponseWrapper-Vserver.json")); - lst = resp.getVfModuleItems(false); - assertEquals(3, lst.size()); - int index; - index = 0; - assertEquals("my-module-abc_1", lst.get(index++).getVfModule().getVfModuleName()); - assertEquals("my-module-abc_123", lst.get(index++).getVfModule().getVfModuleName()); - assertEquals("my-module-abc_34", lst.get(index++).getVfModule().getVfModuleName()); - } - - /** - * Loads a response from a JSON file. - * - * @param fileName name of the file containing the JSON response - * @return the response - * @throws IOException if the file cannot be read - */ - private AaiNqResponse load(String fileName) throws IOException { - String json = IOUtils.toString(getClass().getResource(fileName), StandardCharsets.UTF_8); - return Serialization.gsonPretty.fromJson(json, AaiNqResponse.class); - } -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqServiceInstanceTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqServiceInstanceTest.java deleted file mode 100644 index add616dce..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqServiceInstanceTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import org.onap.policy.aai.util.Serialization; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class AaiNqServiceInstanceTest { - private static final Logger logger = LoggerFactory.getLogger(AaiNqServiceInstanceTest.class); - - @BeforeClass - public static void setUpBeforeClass() throws Exception {} - - @AfterClass - public static void tearDownAfterClass() throws Exception {} - - @Test - public void test() { - AaiNqServiceInstance aaiNqServiceInstance = new AaiNqServiceInstance(); - aaiNqServiceInstance.setServiceInstanceId("dhv-test-vhnfportal-service-instance-id"); - aaiNqServiceInstance.setServiceInstanceName("dhv-test-service-instance-name1"); - aaiNqServiceInstance.setPersonaModelId("82194af1-3c2c-485a-8f44-420e22a9eaa4"); - aaiNqServiceInstance.setPersonaModelVersion("1.0"); - aaiNqServiceInstance.setServiceInstanceLocationId("dhv-test-service-instance-location-id1"); - aaiNqServiceInstance.setResourceVersion("1485366092"); - aaiNqServiceInstance.setModelInvariantId("SomeID"); - aaiNqServiceInstance.setModelVersionId("SomeVersion"); - assertNotNull(aaiNqServiceInstance); - assertEquals("dhv-test-vhnfportal-service-instance-id", aaiNqServiceInstance.getServiceInstanceId()); - assertEquals("dhv-test-service-instance-name1", aaiNqServiceInstance.getServiceInstanceName()); - assertEquals("82194af1-3c2c-485a-8f44-420e22a9eaa4", aaiNqServiceInstance.getPersonaModelId()); - assertEquals("1.0", aaiNqServiceInstance.getPersonaModelVersion()); - assertEquals("dhv-test-service-instance-location-id1", aaiNqServiceInstance.getServiceInstanceLocationId()); - assertEquals("1485366092", aaiNqServiceInstance.getResourceVersion()); - assertEquals("SomeID", aaiNqServiceInstance.getModelInvariantId()); - assertEquals("SomeVersion", aaiNqServiceInstance.getModelVersionId()); - logger.info(Serialization.gsonPretty.toJson(aaiNqServiceInstance)); - } - -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqTenantTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqTenantTest.java deleted file mode 100644 index c1755f9cb..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqTenantTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import org.onap.policy.aai.util.Serialization; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class AaiNqTenantTest { - private static final Logger logger = LoggerFactory.getLogger(AaiNqTenantTest.class); - - @BeforeClass - public static void setUpBeforeClass() throws Exception {} - - @AfterClass - public static void tearDownAfterClass() throws Exception {} - - @Test - public void test() { - AaiNqTenant aaiNqTenant = new AaiNqTenant(); - aaiNqTenant.setTenantId("dhv-test-tenant"); - aaiNqTenant.setTenantName("dhv-test-tenant-name"); - aaiNqTenant.setResourceVersion("1485366334"); - assertNotNull(aaiNqTenant); - assertEquals("dhv-test-tenant", aaiNqTenant.getTenantId()); - assertEquals("dhv-test-tenant-name", aaiNqTenant.getTenantName()); - assertEquals("1485366334", aaiNqTenant.getResourceVersion()); - - logger.info(Serialization.gsonPretty.toJson(aaiNqTenant)); - } - -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqVServerTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqVServerTest.java deleted file mode 100644 index bdda679d5..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqVServerTest.java +++ /dev/null @@ -1,101 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import java.io.File; -import java.nio.file.Files; -import java.util.List; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import org.onap.policy.aai.util.Serialization; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class AaiNqVServerTest { - private static final Logger logger = LoggerFactory.getLogger(AaiNqVServerTest.class); - - - @BeforeClass - public static void setUpBeforeClass() throws Exception {} - - @AfterClass - public static void tearDownAfterClass() throws Exception {} - - @Test - public void test() throws Exception { - // deserialize json and verify fields are populated properly - String json = new String(Files - .readAllBytes(new File("src/test/resources/org/onap/policy/aai/AaiNqVServer.json").toPath())); - - AaiNqVServer resp = Serialization.gsonPretty.fromJson(json, AaiNqVServer.class); - - assertEquals(false, resp.getInMaint()); - assertEquals(true, resp.getIsClosedLoopDisabled()); - assertEquals("ACTIVE", resp.getProvStatus()); - assertEquals("1533850964910", resp.getResourceVersion()); - assertEquals("1c94da3f-16f1-4fc7-9ed1-e018dfa62774", resp.getVserverId()); - assertEquals("vlb-ms-0809-1", resp.getVserverName()); - assertEquals("vlb-ms-0809-7", resp.getVserverName2()); - assertEquals("http://localhost:8774/v2.1/4086f396c5e04caf9502c5fdeca575c4/servers/1c94da3f-16f1-4fc7-9ed1-e018dfa62774", - resp.getVserverSelflink()); - - // don't need to verify this in depth, as it has its own tests that do that - RelationshipList relationshipList = resp.getRelationshipList(); - assertNotNull(relationshipList); - - List lst = relationshipList.getRelationships(); - assertNotNull(lst); - - assertEquals(3, lst.size()); - assertEquals("generic-vnf", lst.get(0).getRelatedTo()); - assertEquals("image", lst.get(1).getRelatedTo()); - - logger.info(Serialization.gsonPretty.toJson(resp)); - - // verify that setXxx methods work - relationshipList = new RelationshipList(); - - resp.setInMaint(true); - resp.setIsClosedLoopDisabled(false); - resp.setProvStatus("inactive"); - resp.setRelationshipList(relationshipList); - resp.setResourceVersion("vers"); - resp.setVserverId("vid"); - resp.setVserverName("vname"); - resp.setVserverName2("vname2"); - resp.setVserverSelflink("link"); - - assertEquals(true, resp.getInMaint()); - assertEquals(false, resp.getIsClosedLoopDisabled()); - assertEquals("inactive", resp.getProvStatus()); - assertEquals("vers", resp.getResourceVersion()); - assertEquals("vid", resp.getVserverId()); - assertEquals("vname", resp.getVserverName()); - assertEquals("vname2", resp.getVserverName2()); - assertEquals("link", resp.getVserverSelflink()); - assertEquals(relationshipList, resp.getRelationshipList()); - } - -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqVfModuleTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqVfModuleTest.java deleted file mode 100644 index b82f2b377..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/AaiNqVfModuleTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import org.onap.policy.aai.util.Serialization; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class AaiNqVfModuleTest { - private static final Logger logger = LoggerFactory.getLogger(AaiNqVfModuleTest.class); - - - @BeforeClass - public static void setUpBeforeClass() throws Exception {} - - @AfterClass - public static void tearDownAfterClass() throws Exception {} - - @Test - public void test() { - AaiNqVfModule aaiNqVfModule = new AaiNqVfModule(); - aaiNqVfModule.setVfModuleId("example-vf-module-id-val-49261"); - aaiNqVfModule.setVfModuleName("example-vf-module-name-val-73074"); - aaiNqVfModule.setHeatStackId("example-heat-stack-id-val-86300"); - aaiNqVfModule.setOrchestrationStatus("example-orchestration-status-val-56523"); - aaiNqVfModule.setIsBaseVfModule(true); - aaiNqVfModule.setResourceVersion("1485366450"); - aaiNqVfModule.setPersonaModelId("ef86f9c5-2165-44f3-8fc3-96018b609ea5"); - aaiNqVfModule.setPersonaModelVersion("1.0"); - aaiNqVfModule.setWidgetModelId("example-widget-model-id-val-92571"); - aaiNqVfModule.setWidgetModelVersion("example-widget-model-version-val-83317"); - aaiNqVfModule.setContrailServiceInstanceFqdn("example-contrail-service-instance-fqdn-val-86796"); - aaiNqVfModule.setModelInvariantId("SomeId"); - aaiNqVfModule.setModelVersionId("SomeVersion"); - aaiNqVfModule.setModelCustomizationId("SomeCustomizationId"); - assertNotNull(aaiNqVfModule); - assertEquals("example-vf-module-id-val-49261", aaiNqVfModule.getVfModuleId()); - assertEquals("example-vf-module-name-val-73074", aaiNqVfModule.getVfModuleName()); - assertEquals("example-heat-stack-id-val-86300", aaiNqVfModule.getHeatStackId()); - assertEquals("example-orchestration-status-val-56523", aaiNqVfModule.getOrchestrationStatus()); - assertEquals(true, aaiNqVfModule.getIsBaseVfModule()); - assertEquals("1485366450", aaiNqVfModule.getResourceVersion()); - assertEquals("ef86f9c5-2165-44f3-8fc3-96018b609ea5", aaiNqVfModule.getPersonaModelId()); - assertEquals("1.0", aaiNqVfModule.getPersonaModelVersion()); - assertEquals("example-widget-model-id-val-92571", aaiNqVfModule.getWidgetModelId()); - assertEquals("example-widget-model-version-val-83317", aaiNqVfModule.getWidgetModelVersion()); - assertEquals("example-contrail-service-instance-fqdn-val-86796", - aaiNqVfModule.getContrailServiceInstanceFqdn()); - assertEquals("SomeId", aaiNqVfModule.getModelInvariantId()); - assertEquals("SomeVersion", aaiNqVfModule.getModelVersionId()); - assertEquals("SomeCustomizationId", aaiNqVfModule.getModelCustomizationId()); - logger.info(Serialization.gsonPretty.toJson(aaiNqVfModule)); - } - -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/PnfInstanceTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/PnfInstanceTest.java deleted file mode 100644 index 495d9f134..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/PnfInstanceTest.java +++ /dev/null @@ -1,105 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import org.onap.policy.aai.util.Serialization; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class PnfInstanceTest { - private static final Logger logger = LoggerFactory.getLogger(PnfInstanceTest.class); - - @BeforeClass - public static void setUpBeforeClass() throws Exception {} - - @AfterClass - public static void tearDownAfterClass() throws Exception {} - - @Test - public void test() { - PnfInstance pnfInstance = new PnfInstance(); - pnfInstance.setPnfInstanceName("pnf-instance-name-test"); - pnfInstance.setPnfName("pnf-name-test"); - pnfInstance.setPnfType(PnfType.ENODEB); - pnfInstance.setPnfSerial("pnf-serial-test"); - assertNotNull(pnfInstance); - assertEquals("pnf-instance-name-test", pnfInstance.getPnfInstanceName()); - - PnfInstance pnfInstanceNull = new PnfInstance(null); - assertNotNull(pnfInstanceNull); - - PnfInstance pnfInstanceClone = new PnfInstance(pnfInstance); - assertNotNull(pnfInstanceClone); - - assertEquals("pnf-name-test", pnfInstanceClone.getPnfName()); - assertEquals(PnfType.ENODEB, pnfInstanceClone.getPnfType()); - assertEquals("pnf-serial-test", pnfInstanceClone.getPnfSerial()); - - assertEquals("PNFInstance [PNFName=pnf-name-test, PNFInstanceName=pnf-instance-name-test, PNFType=eNodeB, " - + "PNFSerial=pnf-serial-test]", pnfInstanceClone.toString()); - assertNotEquals(0, pnfInstanceClone.hashCode()); - assertNotEquals(0, new Pnf().hashCode()); - - PnfInstance pnfInstanceOther0 = new PnfInstance(); - pnfInstanceOther0.setPnfName("pnf-name-test"); - - PnfInstance pnfInstanceOther1 = new PnfInstance(pnfInstance); - pnfInstanceOther1.setPnfName("pnf-name-test-diff"); - - PnfInstance pnfInstanceOther2 = new PnfInstance(pnfInstance); - pnfInstanceOther2.setPnfInstanceName("pnf-instance-name-test-diff"); - - PnfInstance pnfInstanceOther3 = new PnfInstance(pnfInstance); - pnfInstanceOther3.setPnfName(null); - - PnfInstance pnfInstanceOther4 = new PnfInstance(pnfInstance); - pnfInstanceOther4.setPnfSerial(null); - - PnfInstance pnfInstanceOther5 = new PnfInstance(pnfInstance); - pnfInstanceOther5.setPnfSerial("pnf-serial-test-diff"); - - assertTrue(pnfInstance.equals(pnfInstance)); - assertFalse(pnfInstance.equals(null)); - assertFalse(pnfInstance.equals("hello")); - assertTrue(pnfInstance.equals(pnfInstanceClone)); - assertFalse(pnfInstance.equals(new Pnf())); - assertFalse(new Pnf().equals(pnfInstance)); - assertFalse(new Pnf().equals(pnfInstanceOther0)); - assertFalse(pnfInstanceOther0.equals(pnfInstance)); - assertFalse(pnfInstanceOther1.equals(pnfInstance)); - assertFalse(pnfInstanceOther2.equals(pnfInstance)); - assertFalse(pnfInstanceOther3.equals(pnfInstance)); - assertFalse(pnfInstanceOther4.equals(pnfInstance)); - assertFalse(pnfInstanceOther5.equals(pnfInstance)); - - logger.info(Serialization.gsonPretty.toJson(pnfInstance)); - } - -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/PnfTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/PnfTest.java deleted file mode 100644 index 0380c15b0..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/PnfTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import org.onap.policy.aai.util.Serialization; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class PnfTest { - private static final Logger logger = LoggerFactory.getLogger(PnfTest.class); - - @BeforeClass - public static void setUpBeforeClass() throws Exception {} - - @AfterClass - public static void tearDownAfterClass() throws Exception {} - - @Test - public void test() { - Pnf pnf = new Pnf(); - pnf.setPnfName("pnf-name-test"); - pnf.setPnfType(PnfType.ENODEB); - assertNotNull(pnf); - - Pnf pnfClone = new Pnf(pnf); - assertNotNull(pnfClone); - - assertEquals("pnf-name-test", pnfClone.getPnfName()); - assertEquals(PnfType.ENODEB, pnfClone.getPnfType()); - - assertEquals("PNF [PNFName=pnf-name-test, PNFType=eNodeB]", pnfClone.toString()); - assertNotEquals(0, pnfClone.hashCode()); - assertNotEquals(0, new Pnf().hashCode()); - - Pnf pnfOther = new Pnf(); - pnfOther.setPnfName("pnf-name-test"); - - assertTrue(pnf.equals(pnf)); - assertFalse(pnf.equals(null)); - assertFalse(pnf.equals("hello")); - assertTrue(pnf.equals(pnfClone)); - assertFalse(pnf.equals(new Pnf())); - assertFalse(new Pnf().equals(pnf)); - assertFalse(new Pnf().equals(pnfOther)); - assertFalse(pnfOther.equals(pnf)); - - logger.info(Serialization.gsonPretty.toJson(pnf)); - } - -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/PnfTypeTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/PnfTypeTest.java deleted file mode 100644 index e62430ade..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/PnfTypeTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertNotNull; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import org.onap.policy.aai.util.Serialization; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class PnfTypeTest { - private static final Logger logger = LoggerFactory.getLogger(PnfTypeTest.class); - - - @BeforeClass - public static void setUpBeforeClass() throws Exception {} - - @AfterClass - public static void tearDownAfterClass() throws Exception {} - - @Test - public void test() { - PnfType pnfType = PnfType.ENODEB; - assertNotNull(pnfType); - assertNotNull(pnfType.toString()); - logger.info(Serialization.gsonPretty.toJson(pnfType)); - } - -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelatedToPropertyTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelatedToPropertyTest.java deleted file mode 100644 index 832d59f89..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelatedToPropertyTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertEquals; - -import java.io.File; -import java.nio.file.Files; -import org.junit.Test; -import org.onap.policy.aai.util.Serialization; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class RelatedToPropertyTest { - private static final Logger logger = LoggerFactory.getLogger(RelatedToPropertyTest.class); - - @Test - public void test() throws Exception { - // deserialize json and verify fields are populated properly - String json = new String(Files.readAllBytes( - new File("src/test/resources/org/onap/policy/aai/RelatedToProperty.json").toPath())); - - RelatedToProperty relatedToProperty = Serialization.gsonPretty.fromJson(json, RelatedToProperty.class); - - assertEquals("generic-vnf.vnf-name", relatedToProperty.getPropertyKey()); - assertEquals("vLoadBalancerMS-Vnf-0809-1", relatedToProperty.getPropertyValue()); - - logger.info(Serialization.gsonPretty.toJson(relatedToProperty)); - - // verify that setXxx methods work - relatedToProperty.setPropertyKey("a key"); - relatedToProperty.setPropertyValue("a value"); - - assertEquals("a key", relatedToProperty.getPropertyKey()); - assertEquals("a value", relatedToProperty.getPropertyValue()); - } - -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipDataTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipDataTest.java deleted file mode 100644 index 93b1d32c4..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipDataTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertEquals; - -import java.io.File; -import java.nio.file.Files; -import org.junit.Test; -import org.onap.policy.aai.util.Serialization; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class RelationshipDataTest { - private static final Logger logger = LoggerFactory.getLogger(RelationshipDataTest.class); - - @Test - public void test() throws Exception { - // deserialize json and verify fields are populated properly - String json = new String(Files.readAllBytes( - new File("src/test/resources/org/onap/policy/aai/RelationshipData.json").toPath())); - - RelationshipData relationshipData = Serialization.gsonPretty.fromJson(json, RelationshipData.class); - - assertEquals("generic-vnf.vnf-id", relationshipData.getRelationshipKey()); - assertEquals("807a3f02-f878-436b-870c-f0e91e81570d", relationshipData.getRelationshipValue()); - - logger.info(Serialization.gsonPretty.toJson(relationshipData)); - - // verify that setXxx methods work - relationshipData.setRelationshipKey("a key"); - relationshipData.setRelationshipValue("a value"); - - assertEquals("a key", relationshipData.getRelationshipKey()); - assertEquals("a value", relationshipData.getRelationshipValue()); - } - -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipListTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipListTest.java deleted file mode 100644 index d67f2bb8b..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipListTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import java.io.File; -import java.nio.file.Files; -import java.util.LinkedList; -import java.util.List; -import org.junit.Test; -import org.onap.policy.aai.util.Serialization; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class RelationshipListTest { - private static final Logger logger = LoggerFactory.getLogger(RelationshipListTest.class); - - @Test - public void test() throws Exception { - // deserialize json and verify fields are populated properly - String json = new String(Files.readAllBytes( - new File("src/test/resources/org/onap/policy/aai/RelationshipList.json").toPath())); - - RelationshipList relationshipList = Serialization.gsonPretty.fromJson(json, RelationshipList.class); - - List lst = relationshipList.getRelationships(); - assertNotNull(lst); - assertEquals(3, lst.size()); - - // don't need to verify this in depth, as it has its own tests that do that - assertEquals("generic-vnf", lst.get(0).getRelatedTo()); - assertEquals("image", lst.get(1).getRelatedTo()); - assertEquals("flavor", lst.get(2).getRelatedTo()); - - logger.info(Serialization.gsonPretty.toJson(relationshipList)); - - // verify that setXxx methods work - lst = new LinkedList<>(); - lst.add(new Relationship()); - lst.add(new Relationship()); - - relationshipList.setRelationships(lst); - assertEquals(lst, relationshipList.getRelationships()); - } - -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipTest.java deleted file mode 100644 index f229a091a..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/RelationshipTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * Copyright (C) 2017-2018 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.onap.policy.aai; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import java.io.File; -import java.nio.file.Files; -import java.util.LinkedList; -import java.util.List; -import org.junit.Test; -import org.onap.policy.aai.util.Serialization; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class RelationshipTest { - private static final Logger logger = LoggerFactory.getLogger(RelationshipTest.class); - - @Test - public void test() throws Exception { - // deserialize json and verify fields are populated properly - String json = new String(Files - .readAllBytes(new File("src/test/resources/org/onap/policy/aai/Relationship.json").toPath())); - - Relationship relationship = Serialization.gsonPretty.fromJson(json, Relationship.class); - - assertEquals("/aai/v11/network/generic-vnfs/generic-vnf/807a3f02-f878-436b-870c-f0e91e81570d", - relationship.getRelatedLink()); - assertEquals("generic-vnf", relationship.getRelatedTo()); - - // don't need to verify this in depth, as it has its own tests that do that - List relatedToProperty = relationship.getRelatedToProperty(); - assertNotNull(relatedToProperty); - assertEquals(2, relatedToProperty.size()); - assertEquals("vLoadBalancerMS-Vnf-0809-1", relatedToProperty.get(0).getPropertyValue()); - assertEquals("vLoadBalancerMS-Vnf-0809-2", relatedToProperty.get(1).getPropertyValue()); - - // don't need to verify this in depth, as it has its own tests that do that - List relationshipData = relationship.getRelationshipData(); - assertNotNull(relationshipData); - assertEquals(2, relationshipData.size()); - assertEquals("807a3f02-f878-436b-870c-f0e91e81570d", relationshipData.get(0).getRelationshipValue()); - assertEquals("907a3f02-f878-436b-870c-f0e91e81570e", relationshipData.get(1).getRelationshipValue()); - - logger.info(Serialization.gsonPretty.toJson(relationship)); - - // verify that setXxx methods work - relatedToProperty = new LinkedList<>(); - relatedToProperty.add(new RelatedToProperty()); - relatedToProperty.add(new RelatedToProperty()); - relatedToProperty.add(new RelatedToProperty()); - - relationshipData = new LinkedList<>(); - relationshipData.add(new RelationshipData()); - relationshipData.add(new RelationshipData()); - relationshipData.add(new RelationshipData()); - - relationship.setRelatedLink("related-link"); - relationship.setRelatedTo("related-to"); - relationship.setRelatedToProperty(relatedToProperty); - relationship.setRelationshipData(relationshipData); - - assertEquals("related-link", relationship.getRelatedLink()); - assertEquals("related-to", relationship.getRelatedTo()); - assertEquals(relatedToProperty, relationship.getRelatedToProperty()); - assertEquals(relationshipData, relationship.getRelationshipData()); - } - -} diff --git a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/util/AaiExceptionTest.java b/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/util/AaiExceptionTest.java deleted file mode 100644 index 69004e7f3..000000000 --- a/controlloop/common/model-impl/aai/src/test/java/org/onap/policy/aai/util/AaiExceptionTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * aai - * ================================================================================ - * 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.onap.policy.aai.util; - -import static org.junit.Assert.assertNotNull; - -import java.io.IOException; - -import org.junit.Test; - -public class AaiExceptionTest { - - @Test - public void test() { - assertNotNull(new AaiException()); - assertNotNull(new AaiException("message")); - assertNotNull(new AaiException("message", new IOException())); - assertNotNull(new AaiException("message", new IOException(), true, false)); - assertNotNull(new AaiException(new IOException())); - } - -} diff --git a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetResponseError.json b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetResponseError.json deleted file mode 100644 index 6751fef5c..000000000 --- a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetResponseError.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "requestError": { - "serviceException": { - "messageId": "SVC3001", - "text": "Resource not found for %1 using id %2 (msg=%3) (ec=%4)", - "variables": [ - "GET", - "network/generic-vnfs/generic-vnf/3f02-f878-436b-870c-f0e91e81570d", - "Node Not Found:No Node of type generic-vnf found at: network/generic-vnfs/generic-vnf/3f02-f878-436b-870c-f0e91e81570d", - "ERR.5.4.6114" - ] - } - } -} diff --git a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetVnfResponse.json b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetVnfResponse.json deleted file mode 100644 index faa0e0e1b..000000000 --- a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetVnfResponse.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "in-maint": false, - "ipv4-oam-address": "10.0.150.1", - "is-closed-loop-disabled": true, - "model-customization-id": "6c1a5439-3b77-4d8a-bb2b-9fe7006ad671", - "model-invariant-id": "53638a85-361a-437d-8830-4b0d5329225e", - "model-version-id": "a82cd55f-1452-4c36-941a-c9f970a3e67c", - "nf-function": "", - "nf-naming-code": "", - "nf-role": "vLB", - "nf-type": "", - "orchestration-status": "Active", - "prov-status": "PROV", - "relationship-list": { - "relationship": [ - { - "related-link": "/aai/v11/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vLB/service-instances/service-instance/b66d24cc-feca-4fdc-8090-2e9539a8bbac", - "related-to": "service-instance", - "related-to-property": [ - { - "property-key": "service-instance.service-instance-name", - "property-value": "vLoadBalancerMS-Service-0809-1" - } - ], - "relationship-data": [ - { - "relationship-key": "customer.global-customer-id", - "relationship-value": "Demonstration" - }, - { - "relationship-key": "service-subscription.service-type", - "relationship-value": "vLB" - }, - { - "relationship-key": "service-instance.service-instance-id", - "relationship-value": "b66d24cc-feca-4fdc-8090-2e9539a8bbac" - } - ] - }, - { - "related-link": "/aai/v11/business/lines-of-business/line-of-business/Test-Business", - "related-to": "line-of-business", - "relationship-data": [ - { - "relationship-key": "line-of-business.line-of-business-name", - "relationship-value": "Test-Business" - } - ] - }, - { - "related-link": "/aai/v11/business/platforms/platform/Test-Platform", - "related-to": "platform", - "relationship-data": [ - { - "relationship-key": "platform.platform-name", - "relationship-value": "Test-Platform" - } - ] - }, - { - "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant/4086f396c5e04caf9502c5fdeca575c4/vservers/vserver/191729bd-cb1d-485d-aa06-b20c888272a8", - "related-to": "vserver", - "related-to-property": [ - { - "property-key": "vserver.vserver-name", - "property-value": "vdns-ms01-0809-1" - } - ], - "relationship-data": [ - { - "relationship-key": "cloud-region.cloud-owner", - "relationship-value": "CloudOwner" - }, - { - "relationship-key": "cloud-region.cloud-region-id", - "relationship-value": "RegionOne" - }, - { - "relationship-key": "tenant.tenant-id", - "relationship-value": "4086f396c5e04caf9502c5fdeca575c4" - }, - { - "relationship-key": "vserver.vserver-id", - "relationship-value": "191729bd-cb1d-485d-aa06-b20c888272a8" - } - ] - }, - { - "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant/4086f396c5e04caf9502c5fdeca575c4/vservers/vserver/1c94da3f-16f1-4fc7-9ed1-e018dfa62774", - "related-to": "vserver", - "related-to-property": [ - { - "property-key": "vserver.vserver-name", - "property-value": "vlb-ms-0809-1" - } - ], - "relationship-data": [ - { - "relationship-key": "cloud-region.cloud-owner", - "relationship-value": "CloudOwner" - }, - { - "relationship-key": "cloud-region.cloud-region-id", - "relationship-value": "RegionOne" - }, - { - "relationship-key": "tenant.tenant-id", - "relationship-value": "4086f396c5e04caf9502c5fdeca575c4" - }, - { - "relationship-key": "vserver.vserver-id", - "relationship-value": "1c94da3f-16f1-4fc7-9ed1-e018dfa62774" - } - ] - } - ] - }, - "resource-version": "1533850960381", - "service-id": "50e1b0be-e0c9-48e2-9f42-15279a783ee8", - "vnf-id": "807a3f02-f878-436b-870c-f0e91e81570d", - "vnf-name": "vLoadBalancerMS-Vnf-0809-2", - "vnf-type": "vLoadBalancerMS/vLoadBalancerMS 0" -} diff --git a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetVserverResponse.json b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetVserverResponse.json deleted file mode 100644 index 19885942e..000000000 --- a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiGetVserverResponse.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "vserver": [ - { - "in-maint": false, - "is-closed-loop-disabled": true, - "prov-status": "ACTIVE", - "relationship-list": { - "relationship": [ - { - "related-link": "/aai/v11/network/generic-vnfs/generic-vnf/807a3f02-f878-436b-870c-f0e91e81570d", - "related-to": "generic-vnf", - "related-to-property": [ - { - "property-key": "generic-vnf.vnf-name", - "property-value": "vLoadBalancerMS-Vnf-0809-2" - } - ], - "relationship-data": [ - { - "relationship-key": "generic-vnf.vnf-id", - "relationship-value": "807a3f02-f878-436b-870c-f0e91e81570d" - } - ] - }, - { - "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/images/image/6e219e86-cd94-4989-9119-def29aa10b12", - "related-to": "image", - "related-to-property": [ - { - "property-key": "image.image-name", - "property-value": "unknown" - } - ], - "relationship-data": [ - { - "relationship-key": "cloud-region.cloud-owner", - "relationship-value": "CloudOwner" - }, - { - "relationship-key": "cloud-region.cloud-region-id", - "relationship-value": "RegionOne" - }, - { - "relationship-key": "image.image-id", - "relationship-value": "6e219e86-cd94-4989-9119-def29aa10b12" - } - ] - }, - { - "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/764efb04-5a46-4806-a766-2bdd24559f39", - "related-to": "flavor", - "related-to-property": [ - { - "property-key": "flavor.flavor-name", - "property-value": "m1.medium" - } - ], - "relationship-data": [ - { - "relationship-key": "cloud-region.cloud-owner", - "relationship-value": "CloudOwner" - }, - { - "relationship-key": "cloud-region.cloud-region-id", - "relationship-value": "RegionOne" - }, - { - "relationship-key": "flavor.flavor-id", - "relationship-value": "764efb04-5a46-4806-a766-2bdd24559f39" - } - ] - } - ] - }, - "resource-version": "1533850964910", - "vserver-id": "1c94da3f-16f1-4fc7-9ed1-e018dfa62774", - "vserver-name": "vlb-ms-0809-1", - "vserver-name2": "vlb-ms-0809-7", - "vserver-selflink": "http://localhost:8774/v2.1/4086f396c5e04caf9502c5fdeca575c4/servers/1c94da3f-16f1-4fc7-9ed1-e018dfa62774" - } - ] -} diff --git a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqResponseWrapper-NoItems.json b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqResponseWrapper-NoItems.json deleted file mode 100644 index 996692402..000000000 --- a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqResponseWrapper-NoItems.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "inventory-response-item": [ - { - "extra-properties": {}, - "inventory-response-items": { - "inventory-response-item": [ - { - "extra-properties": { - "extra-property": [ - { - "property-name": "model-ver.model-version-id", - "property-value": "a82cd55f-1452-4c36-941a-c9f970a3e67c" - }, - { - "property-name": "model-ver.model-name", - "property-value": "vLoadBalancerMS" - }, - { - "property-name": "model.model-type", - "property-value": "resource" - }, - { - "property-name": "model.model-invariant-id", - "property-value": "53638a85-361a-437d-8830-4b0d5329225e" - }, - { - "property-name": "model-ver.model-version", - "property-value": "1.0" - } - ] - }, - "generic-vnf": { - "in-maint": false, - "ipv4-oam-address": "10.0.150.1", - "is-closed-loop-disabled": false, - "model-customization-id": "6c1a5439-3b77-4d8a-bb2b-9fe7006ad671", - "model-invariant-id": "53638a85-361a-437d-8830-4b0d5329225e", - "model-version-id": "a82cd55f-1452-4c36-941a-c9f970a3e67c", - "nf-function": "", - "nf-naming-code": "", - "nf-role": "vLB", - "nf-type": "", - "orchestration-status": "Active", - "prov-status": "PROV", - "resource-version": "1533850960381", - "service-id": "50e1b0be-e0c9-48e2-9f42-15279a783ee8", - "vnf-id": "807a3f02-f878-436b-870c-f0e91e81570d", - "vnf-name": "vLoadBalancerMS-Vnf-0809-2", - "vnf-type": "vLoadBalancerMS/vLoadBalancerMS 0" - }, - "inventory-response-items": { - "inventory-response-item": [ - ] - }, - "model-name": "vLoadBalancerMS" - }, - { - "extra-properties": {}, - "inventory-response-items": { - "inventory-response-item": [ - { - "cloud-region": { - "cloud-owner": "CloudOwner", - "cloud-region-id": "RegionOne", - "cloud-region-version": "v2.5", - "cloud-type": "openstack", - "cloud-zone": "zone-1", - "owner-defined-type": "owner type", - "resource-version": "1533652058185", - "sriov-automation": false - }, - "extra-properties": {} - } - ] - }, - "tenant": { - "resource-version": "1533652058206", - "tenant-id": "4086f396c5e04caf9502c5fdeca575c4", - "tenant-name": "PFPP" - } - } - ] - }, - "vserver": { - "in-maint": false, - "is-closed-loop-disabled": false, - "prov-status": "ACTIVE", - "resource-version": "1533850964910", - "vserver-id": "1c94da3f-16f1-4fc7-9ed1-e018dfa62774", - "vserver-name": "vlb-ms-0809-1", - "vserver-name2": "vlb-ms-0809-1", - "vserver-selflink": "http://10.12.25.2:8774/v2.1/4086f396c5e04caf9502c5fdeca575c4/servers/1c94da3f-16f1-4fc7-9ed1-e018dfa62774" - } - } - ] -} diff --git a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqResponseWrapper-NoModules.json b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqResponseWrapper-NoModules.json deleted file mode 100644 index 2dd6090c7..000000000 --- a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqResponseWrapper-NoModules.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "inventory-response-item": [ - { - "extra-properties": {}, - "inventory-response-items": { - "inventory-response-item": [ - { - "extra-properties": { - "extra-property": [ - { - "property-name": "model-ver.model-version-id", - "property-value": "a82cd55f-1452-4c36-941a-c9f970a3e67c" - }, - { - "property-name": "model-ver.model-name", - "property-value": "vLoadBalancerMS" - }, - { - "property-name": "model.model-type", - "property-value": "resource" - }, - { - "property-name": "model.model-invariant-id", - "property-value": "53638a85-361a-437d-8830-4b0d5329225e" - }, - { - "property-name": "model-ver.model-version", - "property-value": "1.0" - } - ] - }, - "generic-vnf": { - "in-maint": false, - "ipv4-oam-address": "10.0.150.1", - "is-closed-loop-disabled": false, - "model-customization-id": "6c1a5439-3b77-4d8a-bb2b-9fe7006ad671", - "model-invariant-id": "53638a85-361a-437d-8830-4b0d5329225e", - "model-version-id": "a82cd55f-1452-4c36-941a-c9f970a3e67c", - "nf-function": "", - "nf-naming-code": "", - "nf-role": "vLB", - "nf-type": "", - "orchestration-status": "Active", - "prov-status": "PROV", - "resource-version": "1533850960381", - "service-id": "50e1b0be-e0c9-48e2-9f42-15279a783ee8", - "vnf-id": "807a3f02-f878-436b-870c-f0e91e81570d", - "vnf-name": "vLoadBalancerMS-Vnf-0809-2", - "vnf-type": "vLoadBalancerMS/vLoadBalancerMS 0" - }, - "inventory-response-items": { - "inventory-response-item": [ - { - "extra-properties": { - "extra-property": [ - { - "property-name": "model-ver.model-version-id", - "property-value": "4feb459d-d8ef-4cde-a714-235c79787962" - }, - { - "property-name": "model-ver.model-name", - "property-value": "vLoadBalancerMS" - }, - { - "property-name": "model.model-type", - "property-value": "service" - }, - { - "property-name": "model.model-invariant-id", - "property-value": "b5477216-9b7d-4e75-8777-5b632d406759" - }, - { - "property-name": "model-ver.model-version", - "property-value": "1.0" - } - ] - }, - "model-name": "vLoadBalancerMS", - "service-instance": { - "environment-context": "General_Revenue-Bearing", - "model-invariant-id": "b5477216-9b7d-4e75-8777-5b632d406759", - "model-version-id": "4feb459d-d8ef-4cde-a714-235c79787962", - "orchestration-status": "Active", - "resource-version": "1533848425145", - "service-instance-id": "b66d24cc-feca-4fdc-8090-2e9539a8bbac", - "service-instance-name": "vLoadBalancerMS-Service-0809-1", - "workload-context": "Production" - } - } - ] - }, - "model-name": "vLoadBalancerMS" - }, - { - "extra-properties": {}, - "inventory-response-items": { - "inventory-response-item": [ - { - "cloud-region": { - "cloud-owner": "CloudOwner", - "cloud-region-id": "RegionOne", - "cloud-region-version": "v2.5", - "cloud-type": "openstack", - "cloud-zone": "zone-1", - "owner-defined-type": "owner type", - "resource-version": "1533652058185", - "sriov-automation": false - }, - "extra-properties": {} - } - ] - }, - "tenant": { - "resource-version": "1533652058206", - "tenant-id": "4086f396c5e04caf9502c5fdeca575c4", - "tenant-name": "PFPP" - } - } - ] - }, - "vserver": { - "in-maint": false, - "is-closed-loop-disabled": false, - "prov-status": "ACTIVE", - "resource-version": "1533850964910", - "vserver-id": "1c94da3f-16f1-4fc7-9ed1-e018dfa62774", - "vserver-name": "vlb-ms-0809-1", - "vserver-name2": "vlb-ms-0809-1", - "vserver-selflink": "http://10.12.25.2:8774/v2.1/4086f396c5e04caf9502c5fdeca575c4/servers/1c94da3f-16f1-4fc7-9ed1-e018dfa62774" - } - } - ] -} diff --git a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqResponseWrapper-NoNames.json b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqResponseWrapper-NoNames.json deleted file mode 100644 index 9c1a9bc5d..000000000 --- a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqResponseWrapper-NoNames.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "inventory-response-item": [ - { - "extra-properties": {}, - "inventory-response-items": { - "inventory-response-item": [ - { - "extra-properties": { - "extra-property": [ - { - "property-name": "model-ver.model-version-id", - "property-value": "a82cd55f-1452-4c36-941a-c9f970a3e67c" - }, - { - "property-name": "model-ver.model-name", - "property-value": "vLoadBalancerMS" - }, - { - "property-name": "model.model-type", - "property-value": "resource" - }, - { - "property-name": "model.model-invariant-id", - "property-value": "53638a85-361a-437d-8830-4b0d5329225e" - }, - { - "property-name": "model-ver.model-version", - "property-value": "1.0" - } - ] - }, - "generic-vnf": { - "in-maint": false, - "ipv4-oam-address": "10.0.150.1", - "is-closed-loop-disabled": false, - "model-customization-id": "6c1a5439-3b77-4d8a-bb2b-9fe7006ad671", - "model-invariant-id": "53638a85-361a-437d-8830-4b0d5329225e", - "model-version-id": "a82cd55f-1452-4c36-941a-c9f970a3e67c", - "nf-function": "", - "nf-naming-code": "", - "nf-role": "vLB", - "nf-type": "", - "orchestration-status": "Active", - "prov-status": "PROV", - "resource-version": "1533850960381", - "service-id": "50e1b0be-e0c9-48e2-9f42-15279a783ee8", - "vnf-id": "807a3f02-f878-436b-870c-f0e91e81570d", - "vnf-name": "vLoadBalancerMS-Vnf-0809-2", - "vnf-type": "vLoadBalancerMS/vLoadBalancerMS 0" - }, - "inventory-response-items": { - "inventory-response-item": [ - { - "model-name": "vLoadBalancerMS", - "service-instance": { - "environment-context": "General_Revenue-Bearing", - "model-invariant-id": "b5477216-9b7d-4e75-8777-5b632d406759", - "model-version-id": "4feb459d-d8ef-4cde-a714-235c79787962", - "orchestration-status": "Active", - "resource-version": "1533848425145", - "service-instance-id": "b66d24cc-feca-4fdc-8090-2e9539a8bbac", - "service-instance-name": "vLoadBalancerMS-Service-0809-1", - "workload-context": "Production" - } - }, - { - "vf-module": { - "is-base-vf-module": false, - "model-invariant-id": "6d01b7f1-769a-4080-b8ea-57fd03ef1572", - "model-version-id": "3302088a-457e-496c-9282-2eb3d5b8dd24", - "resource-version": "1534270663202", - "vf-module-id": "dummy_807a3f02-f878-436b-870c-f0e91e81570d", - "vf-module-name": "dummy_807a3f02-f878-436b-870c-f0e91e81570d" - } - }, - { - "vf-module": { - "heat-stack-id": "Vfmodule_vLBMS-0809-1/83ab2394-2b22-40f9-8ba2-383698dd2958", - "is-base-vf-module": true, - "model-customization-id": "5198f732-8f22-48f9-98f8-d6b8b50118be", - "model-invariant-id": "1f566a81-58ba-4762-81f9-d2259509429a", - "model-version-id": "94827d25-4ac3-4850-abfc-7b6e3c531db4", - "module-index": 0, - "orchestration-status": "active", - "resource-version": "1533850416834", - "vf-module-id": "b861467d-d3a7-4b21-81b3-94d928a7e8b7", - "vf-module-name": "Vfmodule_vLBMS-0809-1" - } - } - ] - }, - "model-name": "vLoadBalancerMS" - }, - { - "extra-properties": {}, - "inventory-response-items": { - "inventory-response-item": [ - { - "cloud-region": { - "cloud-owner": "CloudOwner", - "cloud-region-id": "RegionOne", - "cloud-region-version": "v2.5", - "cloud-type": "openstack", - "cloud-zone": "zone-1", - "owner-defined-type": "owner type", - "resource-version": "1533652058185", - "sriov-automation": false - }, - "extra-properties": {} - } - ] - }, - "tenant": { - "resource-version": "1533652058206", - "tenant-id": "4086f396c5e04caf9502c5fdeca575c4", - "tenant-name": "PFPP" - } - } - ] - }, - "vserver": { - "in-maint": false, - "is-closed-loop-disabled": false, - "prov-status": "ACTIVE", - "resource-version": "1533850964910", - "vserver-id": "1c94da3f-16f1-4fc7-9ed1-e018dfa62774", - "vserver-name": "vlb-ms-0809-1", - "vserver-name2": "vlb-ms-0809-1", - "vserver-selflink": "http://10.12.25.2:8774/v2.1/4086f396c5e04caf9502c5fdeca575c4/servers/1c94da3f-16f1-4fc7-9ed1-e018dfa62774" - } - } - ] -} diff --git a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqResponseWrapper-Vserver.json b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqResponseWrapper-Vserver.json deleted file mode 100644 index fb341dc65..000000000 --- a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqResponseWrapper-Vserver.json +++ /dev/null @@ -1,157 +0,0 @@ -{ - "inventory-response-item": [ - { - "extra-properties": {}, - "inventory-response-items": { - "inventory-response-item": [ - { - "extra-properties": { - "extra-property": [ - { - "property-name": "model-ver.model-version-id", - "property-value": "a82cd55f-1452-4c36-941a-c9f970a3e67c" - }, - { - "property-name": "model-ver.model-name", - "property-value": "vLoadBalancerMS" - }, - { - "property-name": "model.model-type", - "property-value": "resource" - }, - { - "property-name": "model.model-invariant-id", - "property-value": "53638a85-361a-437d-8830-4b0d5329225e" - }, - { - "property-name": "model-ver.model-version", - "property-value": "1.0" - } - ] - }, - "generic-vnf": { - "in-maint": false, - "ipv4-oam-address": "10.0.150.1", - "is-closed-loop-disabled": false, - "model-customization-id": "6c1a5439-3b77-4d8a-bb2b-9fe7006ad671", - "model-invariant-id": "53638a85-361a-437d-8830-4b0d5329225e", - "model-version-id": "a82cd55f-1452-4c36-941a-c9f970a3e67c", - "nf-function": "", - "nf-naming-code": "", - "nf-role": "vLB", - "nf-type": "", - "orchestration-status": "Active", - "prov-status": "PROV", - "resource-version": "1533850960381", - "service-id": "50e1b0be-e0c9-48e2-9f42-15279a783ee8", - "vnf-id": "807a3f02-f878-436b-870c-f0e91e81570d", - "vnf-name": "vLoadBalancerMS-Vnf-0809-2", - "vnf-type": "vLoadBalancerMS/vLoadBalancerMS 0" - }, - "inventory-response-items": { - "inventory-response-item": [ - { - "model-name": "vLoadBalancerMS", - "service-instance": { - "environment-context": "General_Revenue-Bearing", - "model-invariant-id": "b5477216-9b7d-4e75-8777-5b632d406759", - "model-version-id": "4feb459d-d8ef-4cde-a714-235c79787962", - "orchestration-status": "Active", - "resource-version": "1533848425145", - "service-instance-id": "b66d24cc-feca-4fdc-8090-2e9539a8bbac", - "service-instance-name": "vLoadBalancerMS-Service-0809-1", - "workload-context": "Production" - } - }, - { - "vf-module": { - "is-base-vf-module": false, - "model-invariant-id": "6d01b7f1-769a-4080-b8ea-57fd03ef1572", - "model-version-id": "3302088a-457e-496c-9282-2eb3d5b8dd24", - "resource-version": "1534270663202", - "vf-module-id": "dummy_807a3f02-f878-436b-870c-f0e91e81570d", - "vf-module-name": "dummy_807a3f02-f878-436b-870c-f0e91e81570d" - } - }, - { - "vf-module": { - "is-base-vf-module": false, - "vf-module-name": "my-module-abc_1" - } - }, - { - "vf-module": { - "heat-stack-id": "Vfmodule_vLBMS-0809-1/83ab2394-2b22-40f9-8ba2-383698dd2958", - "is-base-vf-module": true, - "model-customization-id": "5198f732-8f22-48f9-98f8-d6b8b50118be", - "model-invariant-id": "1f566a81-58ba-4762-81f9-d2259509429a", - "model-version-id": "94827d25-4ac3-4850-abfc-7b6e3c531db4", - "module-index": 0, - "orchestration-status": "active", - "resource-version": "1533850416834", - "vf-module-id": "b861467d-d3a7-4b21-81b3-94d928a7e8b7", - "vf-module-name": "Vfmodule_vLBMS-0809-1" - } - }, - { - "vf-module": { - "is-base-vf-module": false, - "vf-module-name": "my-module-abc_123" - } - }, - { - "vf-module": { - "is-base-vf-module": false, - "vf-module-name": "no-underscore-number-9999" - } - }, - { - "vf-module": { - "is-base-vf-module": false, - "vf-module-name": "my-module-abc_34" - } - } - ] - }, - "model-name": "vLoadBalancerMS" - }, - { - "extra-properties": {}, - "inventory-response-items": { - "inventory-response-item": [ - { - "cloud-region": { - "cloud-owner": "CloudOwner", - "cloud-region-id": "RegionOne", - "cloud-region-version": "v2.5", - "cloud-type": "openstack", - "cloud-zone": "zone-1", - "owner-defined-type": "owner type", - "resource-version": "1533652058185", - "sriov-automation": false - }, - "extra-properties": {} - } - ] - }, - "tenant": { - "resource-version": "1533652058206", - "tenant-id": "4086f396c5e04caf9502c5fdeca575c4", - "tenant-name": "PFPP" - } - } - ] - }, - "vserver": { - "in-maint": false, - "is-closed-loop-disabled": false, - "prov-status": "ACTIVE", - "resource-version": "1533850964910", - "vserver-id": "1c94da3f-16f1-4fc7-9ed1-e018dfa62774", - "vserver-name": "vlb-ms-0809-1", - "vserver-name2": "vlb-ms-0809-1", - "vserver-selflink": "http://10.12.25.2:8774/v2.1/4086f396c5e04caf9502c5fdeca575c4/servers/1c94da3f-16f1-4fc7-9ed1-e018dfa62774" - } - } - ] -} diff --git a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqVServer.json b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqVServer.json deleted file mode 100644 index 0a59d8a87..000000000 --- a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/AaiNqVServer.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "in-maint": false, - "is-closed-loop-disabled": true, - "prov-status": "ACTIVE", - "relationship-list": { - "relationship": [ - { - "related-link": "/aai/v11/network/generic-vnfs/generic-vnf/807a3f02-f878-436b-870c-f0e91e81570d", - "related-to": "generic-vnf", - "related-to-property": [ - { - "property-key": "generic-vnf.vnf-name", - "property-value": "vLoadBalancerMS-Vnf-0809-2" - } - ], - "relationship-data": [ - { - "relationship-key": "generic-vnf.vnf-id", - "relationship-value": "807a3f02-f878-436b-870c-f0e91e81570d" - } - ] - }, - { - "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/images/image/6e219e86-cd94-4989-9119-def29aa10b12", - "related-to": "image", - "related-to-property": [ - { - "property-key": "image.image-name", - "property-value": "unknown" - } - ], - "relationship-data": [ - { - "relationship-key": "cloud-region.cloud-owner", - "relationship-value": "CloudOwner" - }, - { - "relationship-key": "cloud-region.cloud-region-id", - "relationship-value": "RegionOne" - }, - { - "relationship-key": "image.image-id", - "relationship-value": "6e219e86-cd94-4989-9119-def29aa10b12" - } - ] - }, - { - "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/764efb04-5a46-4806-a766-2bdd24559f39", - "related-to": "flavor", - "related-to-property": [ - { - "property-key": "flavor.flavor-name", - "property-value": "m1.medium" - } - ], - "relationship-data": [ - { - "relationship-key": "cloud-region.cloud-owner", - "relationship-value": "CloudOwner" - }, - { - "relationship-key": "cloud-region.cloud-region-id", - "relationship-value": "RegionOne" - }, - { - "relationship-key": "flavor.flavor-id", - "relationship-value": "764efb04-5a46-4806-a766-2bdd24559f39" - } - ] - } - ] - }, - "resource-version": "1533850964910", - "vserver-id": "1c94da3f-16f1-4fc7-9ed1-e018dfa62774", - "vserver-name": "vlb-ms-0809-1", - "vserver-name2": "vlb-ms-0809-7", - "vserver-selflink": "http://localhost:8774/v2.1/4086f396c5e04caf9502c5fdeca575c4/servers/1c94da3f-16f1-4fc7-9ed1-e018dfa62774" -} diff --git a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelatedToProperty.json b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelatedToProperty.json deleted file mode 100644 index 2211b3725..000000000 --- a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelatedToProperty.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "property-key": "generic-vnf.vnf-name", - "property-value": "vLoadBalancerMS-Vnf-0809-1" -} diff --git a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/Relationship.json b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/Relationship.json deleted file mode 100644 index 39d9ce1b6..000000000 --- a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/Relationship.json +++ /dev/null @@ -1,25 +0,0 @@ - -{ - "related-link": "/aai/v11/network/generic-vnfs/generic-vnf/807a3f02-f878-436b-870c-f0e91e81570d", - "related-to": "generic-vnf", - "related-to-property": [ - { - "property-key": "generic-vnf.vnf-name", - "property-value": "vLoadBalancerMS-Vnf-0809-1" - }, - { - "property-key": "generic-vnf.vnf-name", - "property-value": "vLoadBalancerMS-Vnf-0809-2" - } - ], - "relationship-data": [ - { - "relationship-key": "generic-vnf.vnf-id", - "relationship-value": "807a3f02-f878-436b-870c-f0e91e81570d" - }, - { - "relationship-key": "generic-vnf.vnf-id", - "relationship-value": "907a3f02-f878-436b-870c-f0e91e81570e" - } - ] -} diff --git a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelationshipData.json b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelationshipData.json deleted file mode 100644 index 4bbb39e8f..000000000 --- a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelationshipData.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "relationship-key": "generic-vnf.vnf-id", - "relationship-value": "807a3f02-f878-436b-870c-f0e91e81570d" -} diff --git a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelationshipList.json b/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelationshipList.json deleted file mode 100644 index ae180f056..000000000 --- a/controlloop/common/model-impl/aai/src/test/resources/org/onap/policy/aai/RelationshipList.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "relationship": [ - { - "related-link": "/aai/v11/network/generic-vnfs/generic-vnf/807a3f02-f878-436b-870c-f0e91e81570d", - "related-to": "generic-vnf", - "related-to-property": [ - { - "property-key": "generic-vnf.vnf-name", - "property-value": "vLoadBalancerMS-Vnf-0809-2" - } - ], - "relationship-data": [ - { - "relationship-key": "generic-vnf.vnf-id", - "relationship-value": "807a3f02-f878-436b-870c-f0e91e81570d" - } - ] - }, - { - "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/images/image/6e219e86-cd94-4989-9119-def29aa10b12", - "related-to": "image", - "related-to-property": [ - { - "property-key": "image.image-name", - "property-value": "unknown" - } - ], - "relationship-data": [ - { - "relationship-key": "cloud-region.cloud-owner", - "relationship-value": "CloudOwner" - }, - { - "relationship-key": "cloud-region.cloud-region-id", - "relationship-value": "RegionOne" - }, - { - "relationship-key": "image.image-id", - "relationship-value": "6e219e86-cd94-4989-9119-def29aa10b12" - } - ] - }, - { - "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/flavors/flavor/764efb04-5a46-4806-a766-2bdd24559f39", - "related-to": "flavor", - "related-to-property": [ - { - "property-key": "flavor.flavor-name", - "property-value": "m1.medium" - } - ], - "relationship-data": [ - { - "relationship-key": "cloud-region.cloud-owner", - "relationship-value": "CloudOwner" - }, - { - "relationship-key": "cloud-region.cloud-region-id", - "relationship-value": "RegionOne" - }, - { - "relationship-key": "flavor.flavor-id", - "relationship-value": "764efb04-5a46-4806-a766-2bdd24559f39" - } - ] - } - ] -} -- cgit 1.2.3-korg