diff options
Diffstat (limited to 'integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/utils/general/VendorSoftwareProductRestUtils.java')
-rw-r--r-- | integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/utils/general/VendorSoftwareProductRestUtils.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/utils/general/VendorSoftwareProductRestUtils.java b/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/utils/general/VendorSoftwareProductRestUtils.java index 96d6416236..1eea8f320d 100644 --- a/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/utils/general/VendorSoftwareProductRestUtils.java +++ b/integration-tests/src/test/java/org/onap/sdc/backend/ci/tests/utils/general/VendorSoftwareProductRestUtils.java @@ -23,6 +23,8 @@ package org.onap.sdc.backend.ci.tests.utils.general; import com.aventstack.extentreports.Status; import com.clearspring.analytics.util.Pair; import com.google.gson.Gson; +import java.nio.file.Files; +import java.nio.file.Path; import org.apache.commons.io.IOUtils; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; @@ -58,6 +60,7 @@ import java.util.Iterator; import java.util.Map; import static org.testng.AssertJUnit.assertEquals; +import static org.testng.AssertJUnit.assertTrue; public class VendorSoftwareProductRestUtils { @@ -129,6 +132,13 @@ public class VendorSoftwareProductRestUtils { RestResponse validateUpload = validateUpload(createNewVspPair.right, user); assertEquals("did not succeed to validate upload process, reason: " + validateUpload.getResponse(), 200, validateUpload.getErrorCode().intValue()); + Path expectPath = FileSystems.getDefault().getPath(filepath + File.separator + heatFileName.substring(0, heatFileName.indexOf('.')) + "_expect"); + + if(Files.exists(expectPath)) { + String content = Files.readString(expectPath); + assertTrue(validateUpload.getResponse().contains(content.trim().replaceAll("[\n\r]", ""))); + } + return createNewVspPair.right; } |