summaryrefslogtreecommitdiffstats
path: root/catalog-model/src/test/java/org/openecomp/sdc/be/model/GroupDefinitionTest.java
blob: f8b250d8422d8a11dc4662f47d4911f1099d2b26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package org.openecomp.sdc.be.model;

import org.junit.Test;
import org.openecomp.sdc.be.datatypes.elements.GroupDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;

import java.util.LinkedList;
import java.util.List;


public class GroupDefinitionTest {

	private GroupDefinition createTestSubject() {
		return new GroupDefinition();
	}

	@Test
	public void testCtor() throws Exception {
		new GroupDefinition(new GroupDefinition());
		new GroupDefinition(new GroupDataDefinition());
	}
	
	@Test
	public void testConvertToGroupProperties() throws Exception {
		GroupDefinition testSubject;
		List<GroupProperty> result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.convertToGroupProperties();
		List<PropertyDataDefinition> properties = new LinkedList<>();
		properties.add(new PropertyDataDefinition());
		testSubject.setProperties(properties);
		result = testSubject.convertToGroupProperties();
	}

	
	@Test
	public void testConvertFromGroupProperties() throws Exception {
		GroupDefinition testSubject;
		List<GroupProperty> properties = null;

		// test 1
		testSubject = createTestSubject();
		testSubject.convertFromGroupProperties(properties);
		properties = new LinkedList<>();
		properties.add(new GroupProperty());
		testSubject.convertFromGroupProperties(properties);
	}

	
	@Test
	public void testIsSamePrefix() throws Exception {
		GroupDefinition testSubject;
		String resourceName = "";
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.isSamePrefix(resourceName);
		testSubject.setName("mock");
		result = testSubject.isSamePrefix("mock");
	}
}