2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.mso.vdu.utils;
23 import static org.junit.Assert.*;
25 import java.util.HashMap;
28 import org.junit.Before;
29 import org.junit.Test;
30 import org.openecomp.mso.vdu.utils.VduBlueprint;
32 import org.junit.Assert;
34 public class VduBlueprintTest {
36 private VduBlueprint vduBlueprint;
38 private Map<String, byte[]> templateFiles;
39 private Map<String, byte[]> attachedFiles;
43 vduBlueprint = new VduBlueprint();
47 public void testGetVduModelId() {
48 vduBlueprint.setVduModelId("vduModelId");
49 Assert.assertNotNull(vduBlueprint.getVduModelId());
50 Assert.assertEquals(vduBlueprint.getVduModelId(), "vduModelId");
54 public void testGetMainTemplateName() {
55 vduBlueprint.setMainTemplateName("MainTemplateName");
56 Assert.assertNotNull(vduBlueprint.getMainTemplateName());
57 Assert.assertEquals(vduBlueprint.getMainTemplateName(), "MainTemplateName");
61 public void testGetTemplateFiles() {
62 byte[] templateFileData = "some template file data".getBytes();
63 templateFiles = new HashMap<String, byte[]>();
64 templateFiles.put("templateKey1", templateFileData);
65 vduBlueprint.setTemplateFiles(templateFiles);
66 Assert.assertNotNull(vduBlueprint.getTemplateFiles());
67 Assert.assertTrue(vduBlueprint.getTemplateFiles().containsKey("templateKey1"));
68 Assert.assertTrue(vduBlueprint.getTemplateFiles().containsValue(templateFileData));
72 public void testGetAttachedFiles() {
73 byte[] attachedFileData = "some file data".getBytes();
74 attachedFiles = new HashMap<String, byte[]>();
75 attachedFiles.put("attachedKey1", attachedFileData);
76 vduBlueprint.setAttachedFiles(attachedFiles);
77 Assert.assertNotNull(vduBlueprint.getAttachedFiles());
78 Assert.assertTrue(vduBlueprint.getAttachedFiles().containsKey("attachedKey1"));
79 Assert.assertTrue(vduBlueprint.getAttachedFiles().containsValue(attachedFileData));