aboutsummaryrefslogtreecommitdiffstats
path: root/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/ArtifactUuidFixTest.java
blob: 3fce1b6d66d159f129ae6deea8861806e723f620 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package org.openecomp.sdc.asdctool.impl;

import org.junit.Assert;
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 java.util.List;
import java.util.Map;

public class ArtifactUuidFixTest {

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

	@Test(expected=NullPointerException.class)
	public void testDoFix() throws Exception {
		ArtifactUuidFix testSubject;
		String fixComponent = "";
		String runMode = "";
		boolean result;

		// test 1
		testSubject = createTestSubject();
		fixComponent = "vf_only";
		result = testSubject.doFix(fixComponent, runMode);
		Assert.assertEquals(false, result);

		// test 2
		testSubject = createTestSubject();
		runMode = "service_vf";
		result = testSubject.doFix(fixComponent, runMode);
		Assert.assertEquals(false, result);

		// test 3
		testSubject = createTestSubject();
		runMode = "fix";
		result = testSubject.doFix(fixComponent, runMode);
		Assert.assertEquals(false, result);

		// test 4
		testSubject = createTestSubject();
		runMode = "fix";
		result = testSubject.doFix(fixComponent, runMode);
		Assert.assertEquals(false, result);

		// test 5
		testSubject = createTestSubject();
		runMode = "fix_only_services";
		result = testSubject.doFix(fixComponent, runMode);
		Assert.assertEquals(false, result);
	}

	@Test
	public void testDoFixTosca() throws Exception {
		ArtifactUuidFix testSubject;
		Map<String, List<Component>> nodeToFix = null;
		Map<String, List<Component>> vfToFix = null;
		Map<String, List<Component>> serviceToFix = null;
		boolean result;

		// default test
		testSubject = createTestSubject();
	}

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

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

	@Test(expected=NullPointerException.class)
	public void testValidateTosca() throws Exception {
		ArtifactUuidFix testSubject;
		Map<String, List<Component>> vertices = null;
		Map<String, List<Component>> compToFix = null;
		String name = "";
		boolean result;

		// default test
		testSubject = createTestSubject();
		result = testSubject.validateTosca(vertices, compToFix, name);
	}
}