aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn
diff options
context:
space:
mode:
authorBonkur, Venkat <venkat.bonkur@att.com>2020-05-06 13:55:43 -0400
committerBenjamin, Max (mb388a) <mb388a@att.com>2020-05-06 13:55:44 -0400
commit35575d4a9ba1d8d7c4a987b8de31ad391b8ff71b (patch)
tree5c6d2ff09b0174f11fbb662be5b17864f764c4d0 /bpmn
parent391b1183cced64f2769fe1f2c3cf5b3f696c1d46 (diff)
construct for each platform
construct for each platform instead of whole string of platforms related to network formated the files updated the test case per feedback fixed the compilation error Issue-ID: SO-2897 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: Icc85728fb8ea973d36af863e0b60f0abbaf06219
Diffstat (limited to 'bpmn')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java4
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java4
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java25
3 files changed, 31 insertions, 2 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
index a55cd4c169..385b96c0f8 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
@@ -321,8 +321,8 @@ public class AAICreateTasks {
logger.debug("PlatformName is null in input. Skipping create platform...");
} else {
List<String> platforms = splitCDL(platform.getPlatformName());
- platforms.stream().forEach(
- platformName -> aaiNetworkResources.createPlatformAndConnectNetwork(platform, network));
+ platforms.stream().forEach(platformName -> aaiNetworkResources
+ .createPlatformAndConnectNetwork(new Platform(platformName), network));
}
}
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java
index 4f1ad996dc..e84bfce389 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java
@@ -455,6 +455,10 @@ public class TestDataSetup {
modelInfoNetwork.setModelUUID("testModelUUID" + l3NetworkCounter);
network.setModelInfoNetwork(modelInfoNetwork);
+ Platform platform = new Platform();
+ platform.setPlatformName(" testPlatformName, testPlatformName2 , testPlatformName3 , testPlatformName4");
+ network.setPlatform(platform);
+
return network;
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java
index cb1b9e5ffe..f09e792cf4 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java
@@ -36,6 +36,7 @@ import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.TreeSet;
+import java.util.stream.Collectors;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.junit.Before;
import org.junit.Rule;
@@ -195,6 +196,30 @@ public class AAICreateTasksTest extends BaseTaskTest {
}
@Test
+ public void createPlatformNetworkTest() throws Exception {
+ doNothing().when(aaiNetworkResources).createPlatformAndConnectNetwork(network.getPlatform(), network);
+ aaiCreateTasks.createPlatformForNetwork(execution);
+ ArgumentCaptor<Platform> platformCaptor = ArgumentCaptor.forClass(Platform.class);
+ ArgumentCaptor<L3Network> network = ArgumentCaptor.forClass(L3Network.class);
+ Mockito.verify(aaiNetworkResources, times(4)).createPlatformAndConnectNetwork(platformCaptor.capture(),
+ network.capture());
+
+ List<Platform> capturedPlatforms = platformCaptor.getAllValues();
+
+ String actual = capturedPlatforms.stream().map(item -> item.getPlatformName()).collect(Collectors.toList())
+ .stream().sorted().collect(Collectors.joining(" ,"));
+ String expected =
+ Arrays.asList("testPlatformName", "testPlatformName2", "testPlatformName3", "testPlatformName4")
+ .stream().sorted().collect(Collectors.joining(" ,"));
+
+ assertEquals(expected, actual);
+ assertTrue(capturedPlatforms.stream().anyMatch(item -> "testPlatformName".equals(item.getPlatformName())));
+ assertTrue(capturedPlatforms.stream().anyMatch(item -> "testPlatformName2".equals(item.getPlatformName())));
+ assertTrue(capturedPlatforms.stream().anyMatch(item -> "testPlatformName3".equals(item.getPlatformName())));
+ assertTrue(capturedPlatforms.stream().anyMatch(item -> "testPlatformName4".equals(item.getPlatformName())));
+ }
+
+ @Test
public void createLineOfBusinessTest() throws Exception {
doNothing().when(aaiVnfResources).createLineOfBusinessandConnectVnf(genericVnf.getLineOfBusiness(), genericVnf);
aaiCreateTasks.createLineOfBusiness(execution);