diff options
author | 2017-09-13 17:21:33 +0300 | |
---|---|---|
committer | 2017-09-13 17:21:33 +0300 | |
commit | 6cc9a11a09a9b650442bf301eb8fd1aa6cad66bc (patch) | |
tree | d7a891f71608fd32b1a5a61054530ce0244fe149 /asdc-tests/src/main/java/org | |
parent | 45e38d57442499a535f2915aab95a057e106d79f (diff) |
ComponentBaseTest.java enhancement and
new onboarding class that test onboarding only
And merge release/1710 branch into master
Change-Id: I300d897b151010aa26f8732518fa2e3b7ed4291b
Issue-Id: SDC-331
Signed-off-by: Idan Amit <ia096e@intl.att.com>
Diffstat (limited to 'asdc-tests/src/main/java/org')
7 files changed, 10 insertions, 10 deletions
diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ArtifactServletTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ArtifactServletTest.java index 7e363202bb..1f578d108c 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ArtifactServletTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ArtifactServletTest.java @@ -311,7 +311,7 @@ public class ArtifactServletTest extends ComponentBaseTest { httppost.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate); httppost.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId()); if (addMd5Header) { - httppost.addHeader(HttpHeaderEnum.Content_MD5.getValue(), GeneralUtility.calculateMD5ByString(jsonBody)); + httppost.addHeader(HttpHeaderEnum.Content_MD5.getValue(), GeneralUtility.calculateMD5Base64EncodedByString(jsonBody)); } StringEntity input = new StringEntity(jsonBody); input.setContentType("application/json"); diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/DownloadComponentArt.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/DownloadComponentArt.java index e4c89bee94..65c0bba6a0 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/DownloadComponentArt.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/DownloadComponentArt.java @@ -620,7 +620,7 @@ artifact.setArtifactLabel("configure");*/ httppost.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate); httppost.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId()); if (addMd5Header) { - httppost.addHeader(HttpHeaderEnum.Content_MD5.getValue(), GeneralUtility.calculateMD5ByString(jsonBody)); + httppost.addHeader(HttpHeaderEnum.Content_MD5.getValue(), GeneralUtility.calculateMD5Base64EncodedByString(jsonBody)); } StringEntity input = new StringEntity(jsonBody); input.setContentType("application/json"); diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/CRUDExternalAPI.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/CRUDExternalAPI.java index 4a4e5a4529..45dbf315fb 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/CRUDExternalAPI.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/CRUDExternalAPI.java @@ -3474,7 +3474,7 @@ public class CRUDExternalAPI extends ComponentBaseTest { httppost.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate); httppost.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId()); if (addMd5Header) { - httppost.addHeader(HttpHeaderEnum.Content_MD5.getValue(), GeneralUtility.calculateMD5ByString(jsonBody)); + httppost.addHeader(HttpHeaderEnum.Content_MD5.getValue(), GeneralUtility.calculateMD5Base64EncodedByString(jsonBody)); } StringEntity input = new StringEntity(jsonBody); input.setContentType("application/json"); diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/DistributionDownloadArtifactTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/DistributionDownloadArtifactTest.java index 255dfd9de2..4dbc374e35 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/DistributionDownloadArtifactTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/DistributionDownloadArtifactTest.java @@ -213,7 +213,7 @@ public class DistributionDownloadArtifactTest extends ComponentBaseTest { AssertJUnit.assertEquals(artifactDetails.getPayload(), Base64.encodeBase64String(actualContents.getBytes())); // validating checksum - String actualPayloadChecksum = GeneralUtility.calculateMD5ByByteArray(actualContents.getBytes()); + String actualPayloadChecksum = GeneralUtility.calculateMD5Base64EncodedByByteArray(actualContents.getBytes()); AssertJUnit.assertEquals(expectedPayloadChecksum, actualPayloadChecksum); // validate audit @@ -381,7 +381,7 @@ public class DistributionDownloadArtifactTest extends ComponentBaseTest { // validating checksum byte[] bytes = actualContents.getBytes(); - String actualPayloadChecksum = GeneralUtility.calculateMD5ByByteArray(bytes); + String actualPayloadChecksum = GeneralUtility.calculateMD5Base64EncodedByByteArray(bytes); assertEquals(expectedPayloadChecksum, actualPayloadChecksum); // validating valid zip @@ -576,7 +576,7 @@ public class DistributionDownloadArtifactTest extends ComponentBaseTest { // validating checksum byte[] bytes = actualContents.getBytes(); - String actualPayloadChecksum = GeneralUtility.calculateMD5ByByteArray(bytes); + String actualPayloadChecksum = GeneralUtility.calculateMD5Base64EncodedByByteArray(bytes); AssertJUnit.assertEquals(expectedPayloadChecksum, actualPayloadChecksum); // validating valid zip diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportNewResourceCITest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportNewResourceCITest.java index 56841e1c5d..61c846242c 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportNewResourceCITest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportNewResourceCITest.java @@ -184,7 +184,7 @@ public class ImportNewResourceCITest extends ComponentBaseTest { + " \"icon\": \"router\",\r\n" + " \"tags\": [\r\n" + " \"importResource4test\"\r\n" + " ],\r\n" + " \"payloadData\": \"" + encodedPayload + "\"\r\n" + "}"; - String md5 = GeneralUtility.calculateMD5ByString(json); + String md5 = GeneralUtility.calculateMD5Base64EncodedByString(json); Map<String, String> headers = new HashMap<String, String>(); headers.put(Constants.MD5_HEADER, md5); diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java index b17deb3756..a47477f363 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java @@ -86,7 +86,7 @@ public class ResourceRestUtils extends BaseRestUtils { Gson gson = new Gson(); String userBodyJson = gson.toJson(resourceDetails); - String calculateMD5 = GeneralUtility.calculateMD5ByString(userBodyJson); + String calculateMD5 = GeneralUtility.calculateMD5Base64EncodedByString(userBodyJson); headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), calculateMD5); HttpRequest http = new HttpRequest(); // System.out.println(url); @@ -508,7 +508,7 @@ public class ResourceRestUtils extends BaseRestUtils { Gson gson = new Gson(); String userBodyJson = gson.toJson(resourceDetails); - String calculateMD5 = GeneralUtility.calculateMD5ByString(userBodyJson); + String calculateMD5 = GeneralUtility.calculateMD5Base64EncodedByString(userBodyJson); headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), calculateMD5); HttpRequest http = new HttpRequest(); RestResponse updateResourceResponse = http.httpSendPut(url, userBodyJson, headersMap); diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java index 10f573cf0e..19d7d728fe 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java @@ -48,7 +48,7 @@ public class ResourceRestUtilsExternalAPI extends BaseRestUtils { Gson gson = new Gson(); String userBodyJson = gson.toJson(resourceDetails); - String calculateMD5 = GeneralUtility.calculateMD5ByString(userBodyJson); + String calculateMD5 = GeneralUtility.calculateMD5Base64EncodedByString(userBodyJson); headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), calculateMD5); headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader); headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci"); |