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.onap.so.vdu.utils;
23 import java.util.HashMap;
26 import org.junit.Assert;
27 import org.junit.Before;
28 import org.junit.Test;
30 public class VduBlueprintTest {
32 private VduBlueprint vduBlueprint;
34 private Map<String, byte[]> templateFiles;
35 private Map<String, byte[]> attachedFiles;
39 vduBlueprint = new VduBlueprint();
43 public void testGetVduModelId() {
44 vduBlueprint.setVduModelId("vduModelId");
45 Assert.assertNotNull(vduBlueprint.getVduModelId());
46 Assert.assertEquals("vduModelId", vduBlueprint.getVduModelId());
50 public void testGetMainTemplateName() {
51 vduBlueprint.setMainTemplateName("MainTemplateName");
52 Assert.assertNotNull(vduBlueprint.getMainTemplateName());
53 Assert.assertEquals("MainTemplateName", vduBlueprint.getMainTemplateName());
57 public void testGetTemplateFiles() {
58 byte[] templateFileData = "some template file data".getBytes();
59 templateFiles = new HashMap<>();
60 templateFiles.put("templateKey1", templateFileData);
61 vduBlueprint.setTemplateFiles(templateFiles);
62 Assert.assertNotNull(vduBlueprint.getTemplateFiles());
63 Assert.assertTrue(vduBlueprint.getTemplateFiles().containsKey("templateKey1"));
64 Assert.assertTrue(vduBlueprint.getTemplateFiles().containsValue(templateFileData));
68 public void testGetAttachedFiles() {
69 byte[] attachedFileData = "some file data".getBytes();
70 attachedFiles = new HashMap<>();
71 attachedFiles.put("attachedKey1", attachedFileData);
72 vduBlueprint.setAttachedFiles(attachedFiles);
73 Assert.assertNotNull(vduBlueprint.getAttachedFiles());
74 Assert.assertTrue(vduBlueprint.getAttachedFiles().containsKey("attachedKey1"));
75 Assert.assertTrue(vduBlueprint.getAttachedFiles().containsValue(attachedFileData));