aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authormark.j.leonard <mark.j.leonard@gmail.com>2019-03-27 17:13:21 +0000
committermark.j.leonard <mark.j.leonard@gmail.com>2019-03-28 17:07:39 +0000
commitc1824169b0cfa25101c1efa8118d6b0b085edd15 (patch)
tree949b130c6f48ace5c10e2c584693fec9963d4b28 /src/test
parent834b05d3bf1e0d842a21a3cb31e8150ce0a8927b (diff)
Depend on sdc-tosca version 1.5.0
Replace the following deprecated API methods with equivalent functions: getGroupsOfOriginOfNodeTemplate() getNodeTemplateCustomizationUuid() getNodeTemplateChildren() getServiceVfList() getMembersOfVfModule() getVfModulesByVf() Create a helper class and move the remaining deprecated API calls into a single Java file for ease of maintenance. Change-Id: Icb08b2d66a34b0a3e717adb49f2d62e8f2e2ddb5 Issue-ID: AAI-2294 Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/onap/aai/babel/parser/TestArtifactGeneratorToscaParser.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/test/java/org/onap/aai/babel/parser/TestArtifactGeneratorToscaParser.java b/src/test/java/org/onap/aai/babel/parser/TestArtifactGeneratorToscaParser.java
index 50812c9..2416cc8 100644
--- a/src/test/java/org/onap/aai/babel/parser/TestArtifactGeneratorToscaParser.java
+++ b/src/test/java/org/onap/aai/babel/parser/TestArtifactGeneratorToscaParser.java
@@ -27,6 +27,7 @@ import static org.hamcrest.Matchers.is;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
@@ -189,21 +190,18 @@ public class TestArtifactGeneratorToscaParser {
final String instanceGroupType = "org.openecomp.groups.ResourceInstanceGroup";
WidgetConfigurationUtil.setSupportedInstanceGroups(Collections.singletonList(instanceGroupType));
- ISdcCsarHelper helper = Mockito.mock(ISdcCsarHelper.class);
SubstitutionMappings sm = Mockito.mock(SubstitutionMappings.class);
+ List<Group> groups = Arrays.asList(buildGroup("group", instanceGroupType));
+ Mockito.when(sm.getGroups()).thenReturn(new ArrayList<Group>(groups));
+
NodeTemplate serviceNodeTemplate =
buildNodeTemplate("service", "org.openecomp.resource.cr.a-collection-resource");
serviceNodeTemplate.setSubMappingToscaTemplate(sm);
- Mockito.when(helper.getNodeTemplateByName(serviceNodeTemplate.getName())).thenReturn(serviceNodeTemplate);
- ArrayList<Group> groups = new ArrayList<>();
- groups.add(buildGroup("group", instanceGroupType));
- Mockito.when(helper.getGroupsOfOriginOfNodeTemplate(serviceNodeTemplate)).thenReturn(groups);
-
- ArtifactGeneratorToscaParser parser = new ArtifactGeneratorToscaParser(helper);
Resource groupResource = new Resource(WidgetType.valueOf("INSTANCE_GROUP"), true);
- List<Resource> resources = parser.processInstanceGroups(groupResource, serviceNodeTemplate);
+ List<Resource> resources = new ArtifactGeneratorToscaParser(Mockito.mock(ISdcCsarHelper.class))
+ .processInstanceGroups(groupResource, serviceNodeTemplate);
assertThat(resources.size(), is(1));
Resource resource = resources.get(0);