2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
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.sdc.be.datatypes.elements;
23 import org.junit.Test;
24 import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
26 import java.util.List;
29 public class ListDataDefinitionTest {
31 private ListDataDefinition createTestSubject() {
32 return new ListDataDefinition<AdditionalInfoParameterDataDefinition>();
36 public void testCopyConstructor() throws Exception {
37 ListDataDefinition testSubject;
41 testSubject = createTestSubject();
42 new ListDataDefinition<AdditionalInfoParameterDataDefinition>(testSubject);
46 public void testSetOwnerIdIfEmpty() throws Exception {
47 ListDataDefinition testSubject;
51 testSubject = createTestSubject();
52 testSubject.setOwnerIdIfEmpty(ownerId);
56 public void testFindUidMatch() throws Exception {
57 ListDataDefinition testSubject;
62 testSubject = createTestSubject();
63 result = testSubject.findUidMatch(uid);
67 public void testGetListToscaDataDefinition() throws Exception {
68 ListDataDefinition testSubject;
72 testSubject = createTestSubject();
73 result = testSubject.getListToscaDataDefinition();
77 public void testAdd() throws Exception {
78 ListDataDefinition testSubject;
81 testSubject = createTestSubject();
82 testSubject.add(new AdditionalInfoParameterDataDefinition());
86 public void testDelete() throws Exception {
87 ListDataDefinition testSubject;
90 testSubject = createTestSubject();
91 testSubject.delete(new AdditionalInfoParameterDataDefinition());
95 public void testMergeFunction() throws Exception {
96 ListDataDefinition testSubject;
97 boolean allowDefaultValueOverride = false;
100 testSubject = createTestSubject();
101 ToscaDataDefinition result = testSubject.mergeFunction(testSubject, allowDefaultValueOverride);
105 public void testRemoveByOwnerId() throws Exception {
106 ListDataDefinition testSubject;
107 Set<String> ownerIdList = null;
110 testSubject = createTestSubject();
111 ToscaDataDefinition result = testSubject.removeByOwnerId(ownerIdList);
115 public void testUpdateIfExist() throws Exception {
116 ListDataDefinition testSubject;
117 boolean allowDefaultValueOverride = false;
120 testSubject = createTestSubject();
121 ToscaDataDefinition result = testSubject.updateIfExist(testSubject, true);
125 public void testIsEmpty() throws Exception {
126 ListDataDefinition testSubject;
130 testSubject = createTestSubject();
131 result = testSubject.isEmpty();