1 package org.openecomp.sdc.asdctool.impl;
6 import org.junit.Assert;
8 import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
9 import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum;
10 import org.openecomp.sdc.be.model.Component;
12 public class ArtifactUuidFixTest {
14 private ArtifactUuidFix createTestSubject() {
15 return new ArtifactUuidFix();
18 @Test(expected=NullPointerException.class)
19 public void testDoFix() throws Exception {
20 ArtifactUuidFix testSubject;
21 String fixComponent = "";
26 testSubject = createTestSubject();
27 fixComponent = "vf_only";
28 result = testSubject.doFix(fixComponent, runMode);
29 Assert.assertEquals(false, result);
32 testSubject = createTestSubject();
33 runMode = "service_vf";
34 result = testSubject.doFix(fixComponent, runMode);
35 Assert.assertEquals(false, result);
38 testSubject = createTestSubject();
40 result = testSubject.doFix(fixComponent, runMode);
41 Assert.assertEquals(false, result);
44 testSubject = createTestSubject();
46 result = testSubject.doFix(fixComponent, runMode);
47 Assert.assertEquals(false, result);
50 testSubject = createTestSubject();
51 runMode = "fix_only_services";
52 result = testSubject.doFix(fixComponent, runMode);
53 Assert.assertEquals(false, result);
57 public void testDoFixTosca() throws Exception {
58 ArtifactUuidFix testSubject;
59 Map<String, List<Component>> nodeToFix = null;
60 Map<String, List<Component>> vfToFix = null;
61 Map<String, List<Component>> serviceToFix = null;
65 testSubject = createTestSubject();
68 @Test(expected=NullPointerException.class)
69 public void testGetVerticesToValidate() throws Exception {
70 ArtifactUuidFix testSubject;
71 VertexTypeEnum type = null;
72 Map<GraphPropertyEnum, Object> hasProps = null;
73 Map<String, List<Component>> result;
76 testSubject = createTestSubject();
77 result = testSubject.getVerticesToValidate(type, hasProps);
80 @Test(expected=NullPointerException.class)
81 public void testValidateTosca() throws Exception {
82 ArtifactUuidFix testSubject;
83 Map<String, List<Component>> vertices = null;
84 Map<String, List<Component>> compToFix = null;
89 testSubject = createTestSubject();
90 result = testSubject.validateTosca(vertices, compToFix, name);