summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2018-11-10 11:46:40 -0500
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2018-11-10 11:52:22 -0500
commita21c5617e3b278a1bd179708b0345381632cef2b (patch)
treee326e4e56aa3a0cab994e3cab64594d22df1ffd6 /bpmn/MSOCommonBPMN
parent47ef22e3f9c0261835f1b07a4768e87a3d0fe71b (diff)
Bug fixes November 10th
use network name on delete when heat id not present compare mod count index as Integers Change-Id: I76e567378fed83fb857d4d16b88f7a199d0df475 Issue-ID: SO-1204 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'bpmn/MSOCommonBPMN')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/MsoUtils.groovy3
-rw-r--r--bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoUtilsTest.groovy10
-rw-r--r--bpmn/MSOCommonBPMN/src/test/resources/vfModuleCount.xml44
3 files changed, 55 insertions, 2 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/MsoUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/MsoUtils.groovy
index f9ddd0d430..9a3e1b7349 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/MsoUtils.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/MsoUtils.groovy
@@ -939,7 +939,8 @@ class MsoUtils {
if (moduleIndexList == null || moduleIndexList.size() == 0) {
return "0"
}
- def sortedModuleIndexList = moduleIndexList.sort { a, b -> a.compareTo b }
+
+ def sortedModuleIndexList = moduleIndexList.sort{ a, b -> a as Integer <=> b as Integer}
for (i in 0..sortedModuleIndexList.size()-1) {
if (Integer.parseInt(sortedModuleIndexList[i]) != i) {
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoUtilsTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoUtilsTest.groovy
index dfcf69a931..968a694e11 100644
--- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoUtilsTest.groovy
+++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoUtilsTest.groovy
@@ -287,5 +287,13 @@ class MsoUtilsTest {
}
}
-
+ @Test
+ public void testGetLowestUnusedIndex() {
+ def responseAsString = getFile("vfModuleCount.xml")
+ def index = utils.getLowestUnusedIndex(responseAsString)
+ println " lowest module count test: "
+ println " actual - " + index
+ println " expected - " + "14"
+ assertEquals("expected vs actual", "14", index)
+ }
} \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/vfModuleCount.xml b/bpmn/MSOCommonBPMN/src/test/resources/vfModuleCount.xml
new file mode 100644
index 0000000000..b7dee68a77
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/test/resources/vfModuleCount.xml
@@ -0,0 +1,44 @@
+<vfModules>
+ <vf-module>
+ <module-index>0</module-index>
+ </vf-module>
+ <vf-module>
+ <module-index>1</module-index>
+ </vf-module>
+ <vf-module>
+ <module-index>2</module-index>
+ </vf-module>
+ <vf-module>
+ <module-index>3</module-index>
+ </vf-module>
+ <vf-module>
+ <module-index>4</module-index>
+ </vf-module>
+ <vf-module>
+ <module-index>5</module-index>
+ </vf-module>
+ <vf-module>
+ <module-index>6</module-index>
+ </vf-module>
+ <vf-module>
+ <module-index>7</module-index>
+ </vf-module>
+ <vf-module>
+ <module-index>8</module-index>
+ </vf-module>
+ <vf-module>
+ <module-index>9</module-index>
+ </vf-module>
+ <vf-module>
+ <module-index>10</module-index>
+ </vf-module>
+ <vf-module>
+ <module-index>11</module-index>
+ </vf-module>
+ <vf-module>
+ <module-index>12</module-index>
+ </vf-module>
+ <vf-module>
+ <module-index>13</module-index>
+ </vf-module>
+</vfModules> \ No newline at end of file