Replaced all tabs with spaces in java and pom.xml
[so.git] / adapters / mso-openstack-adapters / src / test / java / org / onap / so / vdu / utils / VduBlueprintTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2018 TechMahindra
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.so.vdu.utils;
22
23 import java.util.HashMap;
24 import java.util.Map;
25 import org.junit.Assert;
26 import org.junit.Before;
27 import org.junit.Test;
28
29 public class VduBlueprintTest {
30
31     private VduBlueprint vduBlueprint;
32
33     private Map<String, byte[]> templateFiles;
34     private Map<String, byte[]> attachedFiles;
35
36     @Before
37     public void setUp() {
38         vduBlueprint = new VduBlueprint();
39     }
40
41     @Test
42     public void testGetVduModelId() {
43         vduBlueprint.setVduModelId("vduModelId");
44         Assert.assertNotNull(vduBlueprint.getVduModelId());
45         Assert.assertEquals("vduModelId", vduBlueprint.getVduModelId());
46     }
47
48     @Test
49     public void testGetMainTemplateName() {
50         vduBlueprint.setMainTemplateName("MainTemplateName");
51         Assert.assertNotNull(vduBlueprint.getMainTemplateName());
52         Assert.assertEquals("MainTemplateName", vduBlueprint.getMainTemplateName());
53     }
54
55     @Test
56     public void testGetTemplateFiles() {
57         byte[] templateFileData = "some template file data".getBytes();
58         templateFiles = new HashMap<>();
59         templateFiles.put("templateKey1", templateFileData);
60         vduBlueprint.setTemplateFiles(templateFiles);
61         Assert.assertNotNull(vduBlueprint.getTemplateFiles());
62         Assert.assertTrue(vduBlueprint.getTemplateFiles().containsKey("templateKey1"));
63         Assert.assertTrue(vduBlueprint.getTemplateFiles().containsValue(templateFileData));
64     }
65
66     @Test
67     public void testGetAttachedFiles() {
68         byte[] attachedFileData = "some file data".getBytes();
69         attachedFiles = new HashMap<>();
70         attachedFiles.put("attachedKey1", attachedFileData);
71         vduBlueprint.setAttachedFiles(attachedFiles);
72         Assert.assertNotNull(vduBlueprint.getAttachedFiles());
73         Assert.assertTrue(vduBlueprint.getAttachedFiles().containsKey("attachedKey1"));
74         Assert.assertTrue(vduBlueprint.getAttachedFiles().containsValue(attachedFileData));
75     }
76 }