2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
6 * Modifications Copyright (C) 2019 Nordix Foundation.
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
22 package org.onap.policy.aai;
24 import static org.junit.Assert.assertEquals;
25 import static org.junit.Assert.assertNotNull;
27 import org.junit.Test;
28 import org.onap.policy.aai.util.Serialization;
29 import org.slf4j.Logger;
30 import org.slf4j.LoggerFactory;
32 public class AaiNqVfModuleTest {
33 private static final Logger logger = LoggerFactory.getLogger(AaiNqVfModuleTest.class);
37 AaiNqVfModule aaiNqVfModule = new AaiNqVfModule();
38 aaiNqVfModule.setVfModuleId("example-vf-module-id-val-49261");
39 aaiNqVfModule.setVfModuleName("example-vf-module-name-val-73074");
40 aaiNqVfModule.setHeatStackId("example-heat-stack-id-val-86300");
41 aaiNqVfModule.setOrchestrationStatus("example-orchestration-status-val-56523");
42 aaiNqVfModule.setIsBaseVfModule(true);
43 aaiNqVfModule.setResourceVersion("1485366450");
44 aaiNqVfModule.setPersonaModelId("ef86f9c5-2165-44f3-8fc3-96018b609ea5");
45 aaiNqVfModule.setPersonaModelVersion("1.0");
46 aaiNqVfModule.setWidgetModelId("example-widget-model-id-val-92571");
47 aaiNqVfModule.setWidgetModelVersion("example-widget-model-version-val-83317");
48 aaiNqVfModule.setContrailServiceInstanceFqdn("example-contrail-service-instance-fqdn-val-86796");
49 aaiNqVfModule.setModelInvariantId("SomeId");
50 aaiNqVfModule.setModelVersionId("SomeVersion");
51 aaiNqVfModule.setModelCustomizationId("SomeCustomizationId");
52 assertNotNull(aaiNqVfModule);
53 assertEquals("example-vf-module-id-val-49261", aaiNqVfModule.getVfModuleId());
54 assertEquals("example-vf-module-name-val-73074", aaiNqVfModule.getVfModuleName());
55 assertEquals("example-heat-stack-id-val-86300", aaiNqVfModule.getHeatStackId());
56 assertEquals("example-orchestration-status-val-56523", aaiNqVfModule.getOrchestrationStatus());
57 assertEquals(true, aaiNqVfModule.getIsBaseVfModule());
58 assertEquals("1485366450", aaiNqVfModule.getResourceVersion());
59 assertEquals("ef86f9c5-2165-44f3-8fc3-96018b609ea5", aaiNqVfModule.getPersonaModelId());
60 assertEquals("1.0", aaiNqVfModule.getPersonaModelVersion());
61 assertEquals("example-widget-model-id-val-92571", aaiNqVfModule.getWidgetModelId());
62 assertEquals("example-widget-model-version-val-83317", aaiNqVfModule.getWidgetModelVersion());
63 assertEquals("example-contrail-service-instance-fqdn-val-86796",
64 aaiNqVfModule.getContrailServiceInstanceFqdn());
65 assertEquals("SomeId", aaiNqVfModule.getModelInvariantId());
66 assertEquals("SomeVersion", aaiNqVfModule.getModelVersionId());
67 assertEquals("SomeCustomizationId", aaiNqVfModule.getModelCustomizationId());
68 logger.info(Serialization.gsonPretty.toJson(aaiNqVfModule));