Fix for adding BDD prefixes for for download

Change-Id: Id796408470330300f79120ba5d39987989aff206
Issue-ID: SDC-990
Signed-off-by: ilanap <ilanap@amdocs.com>
diff --git a/openecomp-bdd/stepDefinitions/Utils.js b/openecomp-bdd/stepDefinitions/Utils.js
index 08d0a2b..4a54ebe 100644
--- a/openecomp-bdd/stepDefinitions/Utils.js
+++ b/openecomp-bdd/stepDefinitions/Utils.js
@@ -17,8 +17,8 @@
 const fs = require('fs');
 require('node-zip');
 
-function _request(context, method, path, data, isBinary=false, prefix='onboarding') {
-	let server = context.server + '/' + context.prefix[prefix];
+function _request(context, method, path, data, isBinary=false, type='onboarding') {
+	let server = context.getUrlForType(type);
 
 	let options = {
 		method: method,
@@ -99,13 +99,14 @@
 	});
 }
 
-function download(context, path, filePath,  callback){
-		let options = {
+function download(context, path, filePath,  callback, type='onboarding') {
+	let server = context.getUrlForType(type);
+	let options = {
 			method: 'GET',
-			url: context.onboarding_server + path,
+			url: server + path,
 			headers: context.headers
 		};
-		var file = fs.createWriteStream(filePath);
+	var file = fs.createWriteStream(filePath);
 		var r = request(options).pipe(file);
 		r.on('error', function (err) {
 			console.log(err);