diff options
author | Lukasz Muszkieta <lukasz.muszkieta@nokia.com> | 2018-02-02 18:06:01 +0100 |
---|---|---|
committer | Lukasz Muszkieta <lukasz.muszkieta@nokia.com> | 2018-02-07 16:51:31 +0100 |
commit | 21f91d2c2f857c09f64a67292df2afcd680e6a15 (patch) | |
tree | 1b0c02d53e007245620de7d5b84d9c7cb1cf0d51 /adapters/mso-vnf-adapter/src/main | |
parent | e62930494cbc3ca8d66eeaf1ded32f838763bbf9 (diff) |
add junit for MsoHeatEnvironmentEntry
Change-Id: Ibc2b9562de8fbfdb60ee09add404bd3923431501
Issue-ID: SO-360
Signed-off-by: Lukasz Muszkieta <lukasz.muszkieta@nokia.com>
Diffstat (limited to 'adapters/mso-vnf-adapter/src/main')
-rw-r--r-- | adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImpl.java | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImpl.java b/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImpl.java index fb86b8c520..f5a47bce01 100644 --- a/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImpl.java +++ b/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfAdapterImpl.java @@ -1200,9 +1200,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { if (heatEnvironmentString != null && heatEnvironmentString.contains ("parameters:")) { //LOGGER.debug ("Have an Environment argument with a parameters: section - will bypass checking for valid params - but will still check for aliases"); LOGGER.debug("Enhanced environment checking enabled - 1604"); - StringBuilder sb = new StringBuilder(heatEnvironmentString); - //LOGGER.debug("About to create MHEE with " + sb); - mhee = new MsoHeatEnvironmentEntry(sb); + mhee = MsoHeatEnvironmentEntry.create(heatEnvironmentString); StringBuilder sb2 = new StringBuilder("\nHeat Template Parameters:\n"); for (HeatTemplateParam parm : heatTemplate.getParameters()) { sb2.append("\t" + parm.getParamName() + ", required=" + parm.isRequired()); @@ -1211,7 +1209,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { sb2.append("Environment says it's not valid! " + mhee.getErrorString()); } else { sb2.append("\nEnvironment:"); - sb2.append(mhee.toFullString()); + sb2.append(mhee); } LOGGER.debug(sb2.toString()); } else { @@ -1292,7 +1290,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { // and it causes problems with json that has arrays String newEnvironmentString = null; if (mhee != null) { - newEnvironmentString = mhee.getRawEntry().toString(); + newEnvironmentString = mhee.getRawEntry(); } // "Fix" the template if it has CR/LF (getting this from Oracle) @@ -1904,10 +1902,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { MsoHeatEnvironmentEntry mhee = null; if (heatEnvironmentString != null && heatEnvironmentString.toLowerCase ().contains ("parameters:")) { LOGGER.debug("Enhanced environment checking enabled - 1604"); - haveEnvironmentParameters = true; - StringBuilder sb = new StringBuilder(heatEnvironmentString); - //LOGGER.debug("About to create MHEE with " + sb); - mhee = new MsoHeatEnvironmentEntry(sb); + mhee = MsoHeatEnvironmentEntry.create(heatEnvironmentString); StringBuilder sb2 = new StringBuilder("\nHeat Template Parameters:\n"); for (HeatTemplateParam parm : heatTemplate.getParameters()) { sb2.append("\t" + parm.getParamName() + ", required=" + parm.isRequired()); @@ -1916,7 +1911,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { sb2.append("Environment says it's not valid! " + mhee.getErrorString()); } else { sb2.append("\nEnvironment:"); - sb2.append(mhee.toFullString()); + sb2.append(mhee); } LOGGER.debug(sb2.toString()); } else { @@ -2041,7 +2036,7 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter { // Just submit the envt entry as received from the database String newEnvironmentString = null; if (mhee != null) { - newEnvironmentString = mhee.getRawEntry().toString(); + newEnvironmentString = mhee.getRawEntry(); } // Remove any extraneous parameters (don't throw an error) |