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;
25 import org.junit.Assert;
26 import org.junit.Before;
27 import org.junit.Test;
29 public class VduBlueprintTest {
31 private VduBlueprint vduBlueprint;
33 private Map<String, byte[]> templateFiles;
34 private Map<String, byte[]> attachedFiles;
38 vduBlueprint = new VduBlueprint();
42 public void testGetVduModelId() {
43 vduBlueprint.setVduModelId("vduModelId");
44 Assert.assertNotNull(vduBlueprint.getVduModelId());
45 Assert.assertEquals("vduModelId", vduBlueprint.getVduModelId());
49 public void testGetMainTemplateName() {
50 vduBlueprint.setMainTemplateName("MainTemplateName");
51 Assert.assertNotNull(vduBlueprint.getMainTemplateName());
52 Assert.assertEquals("MainTemplateName", vduBlueprint.getMainTemplateName());
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));
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));