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.resources.data;
23 import org.junit.Assert;
24 import org.junit.Test;
25 import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
27 import java.util.HashMap;
30 public class TagDataTest {
32 private TagData createTestSubject() {
37 public void testCtor() throws Exception {
38 new TagData(new HashMap<>());
40 new TagData(NodeTypeEnum.Tag);
44 public void testToGraphMap() throws Exception {
46 Map<String, Object> result;
49 testSubject = createTestSubject();
50 result = testSubject.toGraphMap();
54 public void testGetName() throws Exception {
59 testSubject = createTestSubject();
60 result = testSubject.getName();
64 public void testSetName() throws Exception {
69 testSubject = createTestSubject();
70 testSubject.setName(name);
74 public void testToString() throws Exception {
79 testSubject = createTestSubject();
80 result = testSubject.toString();
84 public void testHashCode() throws Exception {
89 testSubject = createTestSubject();
90 result = testSubject.hashCode();
94 public void testEquals() throws Exception {
100 testSubject = createTestSubject();
102 result = testSubject.equals(obj);
103 Assert.assertEquals(false, result);
107 public void testGetUniqueIdKey() throws Exception {
112 testSubject = createTestSubject();
113 result = testSubject.getUniqueIdKey();
117 public void testGetUniqueId() throws Exception {
122 testSubject = createTestSubject();
123 result = testSubject.getUniqueId();