summaryrefslogtreecommitdiffstats
path: root/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ArtifactValidatorExecuterTest.java
blob: 06f557dbc3a83b397114a1591362feb942e0b1ab (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.asdctool.impl.validator.executers;

import org.junit.Test;
import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum;
import org.openecomp.sdc.be.model.Component;
import org.openecomp.sdc.be.model.Resource;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

public class ArtifactValidatorExecuterTest {

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

	@Test
	public void testGetName() throws Exception {
		ArtifactValidatorExecuter testSubject;
		String result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.getName();
	}

	@Test(expected=NullPointerException.class)
	public void testGetVerticesToValidate() throws Exception {
		ArtifactValidatorExecuter testSubject;
		VertexTypeEnum type = null;
		Map<GraphPropertyEnum, Object> hasProps = null;

		// default test
		testSubject = createTestSubject();
		testSubject.getVerticesToValidate(type, hasProps);
	}

	@Test
	public void testSetName() throws Exception {
		ArtifactValidatorExecuter testSubject;
		String name = "";

		// default test
		testSubject = createTestSubject();
		testSubject.setName(name);
	}

	@Test(expected=NullPointerException.class)
	public void testValidate() throws Exception {
		ArtifactValidatorExecuter testSubject;
		Map<String, List<Component>> vertices = new HashMap<>();
		LinkedList<Component> linkedList = new LinkedList<Component>();
		linkedList.add(new Resource());
		vertices.put("stam", linkedList);
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.validate(vertices);
	}
}