migrate model-impl from drools-applications
[policy/models.git] / models-interactions / model-impl / aai / src / test / java / org / onap / policy / aai / AaiNqVfModuleTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * aai
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
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
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=========================================================
20  */
21
22 package org.onap.policy.aai;
23
24 import static org.junit.Assert.assertEquals;
25 import static org.junit.Assert.assertNotNull;
26
27 import org.junit.AfterClass;
28 import org.junit.BeforeClass;
29 import org.junit.Test;
30 import org.onap.policy.aai.util.Serialization;
31 import org.slf4j.Logger;
32 import org.slf4j.LoggerFactory;
33
34 public class AaiNqVfModuleTest {
35     private static final Logger logger = LoggerFactory.getLogger(AaiNqVfModuleTest.class);
36
37
38     @BeforeClass
39     public static void setUpBeforeClass() throws Exception {}
40
41     @AfterClass
42     public static void tearDownAfterClass() throws Exception {}
43
44     @Test
45     public void test() {
46         AaiNqVfModule aaiNqVfModule = new AaiNqVfModule();
47         aaiNqVfModule.setVfModuleId("example-vf-module-id-val-49261");
48         aaiNqVfModule.setVfModuleName("example-vf-module-name-val-73074");
49         aaiNqVfModule.setHeatStackId("example-heat-stack-id-val-86300");
50         aaiNqVfModule.setOrchestrationStatus("example-orchestration-status-val-56523");
51         aaiNqVfModule.setIsBaseVfModule(true);
52         aaiNqVfModule.setResourceVersion("1485366450");
53         aaiNqVfModule.setPersonaModelId("ef86f9c5-2165-44f3-8fc3-96018b609ea5");
54         aaiNqVfModule.setPersonaModelVersion("1.0");
55         aaiNqVfModule.setWidgetModelId("example-widget-model-id-val-92571");
56         aaiNqVfModule.setWidgetModelVersion("example-widget-model-version-val-83317");
57         aaiNqVfModule.setContrailServiceInstanceFqdn("example-contrail-service-instance-fqdn-val-86796");
58         aaiNqVfModule.setModelInvariantId("SomeId");
59         aaiNqVfModule.setModelVersionId("SomeVersion");
60         aaiNqVfModule.setModelCustomizationId("SomeCustomizationId");
61         assertNotNull(aaiNqVfModule);
62         assertEquals("example-vf-module-id-val-49261", aaiNqVfModule.getVfModuleId());
63         assertEquals("example-vf-module-name-val-73074", aaiNqVfModule.getVfModuleName());
64         assertEquals("example-heat-stack-id-val-86300", aaiNqVfModule.getHeatStackId());
65         assertEquals("example-orchestration-status-val-56523", aaiNqVfModule.getOrchestrationStatus());
66         assertEquals(true, aaiNqVfModule.getIsBaseVfModule());
67         assertEquals("1485366450", aaiNqVfModule.getResourceVersion());
68         assertEquals("ef86f9c5-2165-44f3-8fc3-96018b609ea5", aaiNqVfModule.getPersonaModelId());
69         assertEquals("1.0", aaiNqVfModule.getPersonaModelVersion());
70         assertEquals("example-widget-model-id-val-92571", aaiNqVfModule.getWidgetModelId());
71         assertEquals("example-widget-model-version-val-83317", aaiNqVfModule.getWidgetModelVersion());
72         assertEquals("example-contrail-service-instance-fqdn-val-86796",
73                         aaiNqVfModule.getContrailServiceInstanceFqdn());
74         assertEquals("SomeId", aaiNqVfModule.getModelInvariantId());
75         assertEquals("SomeVersion", aaiNqVfModule.getModelVersionId());
76         assertEquals("SomeCustomizationId", aaiNqVfModule.getModelCustomizationId());
77         logger.info(Serialization.gsonPretty.toJson(aaiNqVfModule));
78     }
79
80 }