From 5209f06dbfb271048ff5553a880f15f01ce8b757 Mon Sep 17 00:00:00 2001 From: Kartheek Palla Date: Thu, 13 Jun 2024 19:03:28 +0530 Subject: [PATCH 1/7] Issue KN-1096 feat: Azure MediaKind(MK.IO) service enabled to generate streaming URL --- .../resources/video-stream-generator.conf | 18 ++++++++ .../helpers/AzureRequestBody.scala | 2 +- .../service/AzureMediaService.scala | 43 ++++++++----------- 3 files changed, 37 insertions(+), 26 deletions(-) diff --git a/video-stream-generator/src/main/resources/video-stream-generator.conf b/video-stream-generator/src/main/resources/video-stream-generator.conf index ae95f603c..38a248be5 100644 --- a/video-stream-generator/src/main/resources/video-stream-generator.conf +++ b/video-stream-generator/src/main/resources/video-stream-generator.conf @@ -59,6 +59,24 @@ azure { } } +azure_mediakind{ + project_name="subcitionname" + auth_token="authToken" + account_name="media servcie accountname" + api { + endpoint="https://api.mk.io/api" + } + transform { + default = "media_transform_default" + } + stream { + base_url = "https://ep-default-mkservicepoc.japaneast.streaming.mediakind.com" + endpoint_name = "default" + protocol = "Hls" + policy_name = "Predefined_ClearStreamingOnly" + } +} + azure_tenant="tenant" azure_subscription_id="subscription id" azure_account_name="account name" diff --git a/video-stream-generator/src/main/scala/org/sunbird/job/videostream/helpers/AzureRequestBody.scala b/video-stream-generator/src/main/scala/org/sunbird/job/videostream/helpers/AzureRequestBody.scala index d9158c867..4ae426627 100644 --- a/video-stream-generator/src/main/scala/org/sunbird/job/videostream/helpers/AzureRequestBody.scala +++ b/video-stream-generator/src/main/scala/org/sunbird/job/videostream/helpers/AzureRequestBody.scala @@ -2,7 +2,7 @@ package org.sunbird.job.videostream.helpers object AzureRequestBody { - val create_asset = " {\"properties\": {\"description\": \"assetDescription\",\"alternateId\" : \"assetId\"}}" + val create_asset = " {\"properties\": {\"storageAccountName\": \"assetStorageAccountName\",\"description\": \"assetDescription\",\"alternateId\" : \"assetId\"}}" val submit_job = "{\"properties\": {\"input\": {\"@odata.type\": \"#Microsoft.Media.JobInputHttp\",\"baseUri\": \"baseInputUrl\",\"files\": [\"inputVideoFile\"]},\"outputs\": [{\"@odata.type\": \"#Microsoft.Media.JobOutputAsset\",\"assetName\": \"assetId\"}]}}" val create_stream_locator="{\"properties\":{\"assetName\": \"assetId\",\"streamingPolicyName\": \"policyName\"}}" } diff --git a/video-stream-generator/src/main/scala/org/sunbird/job/videostream/service/AzureMediaService.scala b/video-stream-generator/src/main/scala/org/sunbird/job/videostream/service/AzureMediaService.scala index b1d2b1f76..774990630 100644 --- a/video-stream-generator/src/main/scala/org/sunbird/job/videostream/service/AzureMediaService.scala +++ b/video-stream-generator/src/main/scala/org/sunbird/job/videostream/service/AzureMediaService.scala @@ -13,7 +13,6 @@ import scala.collection.immutable.HashMap abstract class AzureMediaService extends IMediaService { private var API_ACCESS_TOKEN: String = "" - private def getToken()(implicit config: VideoStreamGeneratorConfig, httpUtil: HttpUtil): String = { val tenant = config.getSystemConfig("azure.tenant") val clientKey = config.getSystemConfig("azure.token.client_key") @@ -51,9 +50,11 @@ abstract class AzureMediaService extends IMediaService { } protected def createAsset(assetId: String, jobId: String)(implicit config: VideoStreamGeneratorConfig, httpUtil: HttpUtil): MediaResponse = { + val accountName: String = config.getConfig("azure_mediakind.account_name") val url = getApiUrl("asset").replace("assetId", assetId) val requestBody = AzureRequestBody.create_asset.replace("assetId", assetId) .replace("assetDescription", "Output Asset for " + jobId) + .replace("assetStorageAccountName", accountName) val response:MediaResponse = Response.getResponse(httpUtil.put(url, requestBody, getDefaultHeader())) if(response.responseCode == "OK"){ response @@ -64,7 +65,7 @@ abstract class AzureMediaService extends IMediaService { protected def createStreamingLocator(streamingLocatorName: String, assetName: String)(implicit config: VideoStreamGeneratorConfig, httpUtil: HttpUtil): MediaResponse = { val url = getApiUrl("stream_locator").replace("streamingLocatorName", streamingLocatorName) - val streamingPolicyName = config.getConfig("azure.stream.policy_name") + val streamingPolicyName = config.getConfig("azure_mediakind.stream.policy_name") val reqBody = AzureRequestBody.create_stream_locator.replace("assetId", assetName).replace("policyName", streamingPolicyName) Response.getResponse(httpUtil.put(url, reqBody, getDefaultHeader())) } @@ -90,42 +91,34 @@ abstract class AzureMediaService extends IMediaService { } protected def getApiUrl(apiName: String)(implicit config: VideoStreamGeneratorConfig, httpUtil: HttpUtil): String = { - val subscriptionId: String = config.getSystemConfig("azure.subscription_id") - val resourceGroupName: String = config.getSystemConfig("azure.resource_group_name") - val accountName: String = config.getSystemConfig("azure.account_name") - val apiVersion: String = config.getConfig("azure.api.version") - val transformName: String = config.getConfig("azure.transform.default") + val transformName: String = config.getConfig("azure_mediakind.transform.default") + val projectName:String = config.getConfig("azure_mediakind.project_name") - val baseUrl: String = new StringBuilder().append(config.getConfig("azure.api.endpoint")+"/subscriptions/") - .append(subscriptionId) - .append("/resourceGroups/") - .append(resourceGroupName) - .append("/providers/Microsoft.Media/mediaServices/") - .append(accountName).mkString + val baseUrl: String = new StringBuilder().append(config.getConfig("azure_mediakind.api.endpoint")+"/ams/") + .append(projectName).mkString apiName.toLowerCase() match { - case "asset" => baseUrl + "/assets/assetId?api-version=" + apiVersion - case "job" => baseUrl + "/transforms/" + transformName + "/jobs/jobIdentifier?api-version=" + apiVersion - case "stream_locator" => baseUrl + "/streamingLocators/streamingLocatorName?api-version=" + apiVersion - case "list_paths" => baseUrl + "/streamingLocators/streamingLocatorName/listPaths?api-version=" + apiVersion + case "asset" => baseUrl + "/assets/assetId" + case "job" => baseUrl + "/transforms/" + transformName + "/jobs/jobIdentifier" + case "stream_locator" => baseUrl + "/streamingLocators/streamingLocatorName" + case "list_paths" => baseUrl + "/streamingLocators/streamingLocatorName/listPaths" case _ => throw new MediaServiceException("ERR_INVALID_API_NAME", "Please Provide Valid Media Service API Name") } } protected def getDefaultHeader()(implicit config: VideoStreamGeneratorConfig, httpUtil: HttpUtil): Map[String, String] = { - val accessToken = if (StringUtils.isNotBlank(API_ACCESS_TOKEN)) API_ACCESS_TOKEN else getToken() - val authToken = "Bearer " + accessToken + val authToken = config.getConfig("azure_mediakind.auth_token") HashMap[String, String]( - "Content-Type" -> "application/json", - "Accept" -> "application/json", - "Authorization" -> authToken + "content-type" -> "application/json", + "accept" -> "application/json", + "x-mkio-token" -> authToken ) } protected def prepareStreamingUrl(streamLocatorName: String, jobId: String)(implicit config: VideoStreamGeneratorConfig, httpUtil: HttpUtil): Map[String, AnyRef] = { - val streamType = config.getConfig("azure.stream.protocol") - val streamHost = config.getConfig("azure.stream.base_url") + val streamType = config.getConfig("azure_mediakind.stream.protocol") + val streamHost = config.getConfig("azure_mediakind.stream.base_url") var url = "" val listPathResponse = getStreamUrls(streamLocatorName) if (listPathResponse.responseCode.equalsIgnoreCase("OK")) { @@ -146,4 +139,4 @@ abstract class AzureMediaService extends IMediaService { HashMap[String, AnyRef]("streamUrl" -> streamUrl) } } -} +} \ No newline at end of file From 83520811fa0d658ff744ec24976b236d09bbb045 Mon Sep 17 00:00:00 2001 From: shourya-solanki Date: Sat, 15 Jun 2024 11:20:00 +0530 Subject: [PATCH 2/7] Issue #KN-1096 fix: added azure_mediakind configuration to conf --- .../src/test/resources/test.conf | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/video-stream-generator/src/test/resources/test.conf b/video-stream-generator/src/test/resources/test.conf index d92b086ac..ca8ace7f7 100644 --- a/video-stream-generator/src/test/resources/test.conf +++ b/video-stream-generator/src/test/resources/test.conf @@ -60,7 +60,23 @@ threshold.batch.write.size = 4 client_secret = "client secret" } } - +azure_mediakind{ + project_name="subcitionname" + auth_token="authToken" + account_name="media servcie accountname" + api { + endpoint="https://api.mk.io/api" + } + transform { + default = "media_transform_default" + } + stream { + base_url = "https://ep-default-mkservicepoc.japaneast.streaming.mediakind.com" + endpoint_name = "default" + protocol = "Hls" + policy_name = "Predefined_ClearStreamingOnly" + } +} azure_tenant="test_tenant" azure_subscription_id="test_id" azure_account_name="test_account_name" From 0efa382e1a0bb7fed5fcbcd217e6df25cf82838e Mon Sep 17 00:00:00 2001 From: shourya-solanki Date: Sun, 16 Jun 2024 16:06:14 +0530 Subject: [PATCH 3/7] Issue #KN-1096 fix: azure_mediakind test conf --- video-stream-generator/src/test/resources/test.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/video-stream-generator/src/test/resources/test.conf b/video-stream-generator/src/test/resources/test.conf index ca8ace7f7..1a8357caf 100644 --- a/video-stream-generator/src/test/resources/test.conf +++ b/video-stream-generator/src/test/resources/test.conf @@ -60,6 +60,7 @@ threshold.batch.write.size = 4 client_secret = "client secret" } } + azure_mediakind{ project_name="subcitionname" auth_token="authToken" @@ -77,6 +78,7 @@ azure_mediakind{ policy_name = "Predefined_ClearStreamingOnly" } } + azure_tenant="test_tenant" azure_subscription_id="test_id" azure_account_name="test_account_name" From c8a2bc7429b287cc1e3c3ee20d0d9ca526ca557c Mon Sep 17 00:00:00 2001 From: shourya-solanki Date: Mon, 17 Jun 2024 00:05:33 +0530 Subject: [PATCH 4/7] Issue #KN-1096 fix: azure_mediakind tests --- video-stream-generator/src/test/resources/test.conf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/video-stream-generator/src/test/resources/test.conf b/video-stream-generator/src/test/resources/test.conf index 1a8357caf..0e6a338a8 100644 --- a/video-stream-generator/src/test/resources/test.conf +++ b/video-stream-generator/src/test/resources/test.conf @@ -88,5 +88,4 @@ azure_token_client_secret="test_client_secret" elasticsearch.service.endpoint="test_service_endpoint" elasticsearch.index.compositesearch.name="test_compositesearch_name" -media_service_type="azure" - +media_service_type="azure" \ No newline at end of file From 01c5d71c6b59e173204eb95915ca2d40cdf4de0f Mon Sep 17 00:00:00 2001 From: shourya-solanki Date: Tue, 18 Jun 2024 11:03:16 +0530 Subject: [PATCH 5/7] Issue #KN-1096 fix: mediakind tests --- .../job/spec/service/VideoStreamServiceTestSpec.scala | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/video-stream-generator/src/test/scala/org/sunbird/job/spec/service/VideoStreamServiceTestSpec.scala b/video-stream-generator/src/test/scala/org/sunbird/job/spec/service/VideoStreamServiceTestSpec.scala index e1d2998b9..51d250cdb 100644 --- a/video-stream-generator/src/test/scala/org/sunbird/job/spec/service/VideoStreamServiceTestSpec.scala +++ b/video-stream-generator/src/test/scala/org/sunbird/job/spec/service/VideoStreamServiceTestSpec.scala @@ -58,13 +58,12 @@ class VideoStreamServiceTestSpec extends BaseTestSpec { "VideoStreamService" should "submit job request" in { when(mockHttpUtil.post_map(contains("/oauth2/token"), any[Map[String, AnyRef]](), any[Map[String, String]]())).thenReturn(HTTPResponse(200, accessTokenResp)) - when(mockHttpUtil.put(contains("/providers/Microsoft.Media/mediaServices/"+jobConfig.getSystemConfig("azure.account.name")+"/assets/asset-"), anyString(), any())).thenReturn(HTTPResponse(200, assetJson)) + when(mockHttpUtil.put(contains("subcitionname/assets/asset-"), anyString(), any())).thenReturn(HTTPResponse(200, assetJson)) when(mockHttpUtil.put(contains("transforms/media_transform_default/jobs"), anyString(), any())).thenReturn(HTTPResponse(200, submitJobJson)) when(mockHttpUtil.get(contains("transforms/media_transform_default/jobs"), any())).thenReturn(HTTPResponse(200, getJobJson)) - - when(mockHttpUtil.post(contains("/streamingLocators/sl-do_3126597193576939521910_1605816926271/listPaths?api-version="), any(), any())).thenReturn(HTTPResponse(200, getStreamUrlJson)) - when(mockHttpUtil.put(contains("/streamingLocators/sl-do_3126597193576939521910_1605816926271?api-version="), any(), any())).thenReturn(HTTPResponse(400, getJobJson)) - when(mockHttpUtil.get(contains("/streamingLocators/sl-do_3126597193576939521910_1605816926271?api-version="), any())).thenReturn(HTTPResponse(200, getStreamLocatorJson)) + when(mockHttpUtil.post(contains("/streamingLocators/sl-do_3126597193576939521910_1605816926271/listPaths"), any(), any())).thenReturn(HTTPResponse(200, getStreamUrlJson)) + when(mockHttpUtil.put(contains("/streamingLocators/sl-do_3126597193576939521910_1605816926271"), any(), any())).thenReturn(HTTPResponse(400, getJobJson)) + when(mockHttpUtil.get(contains("/streamingLocators/sl-do_3126597193576939521910_1605816926271"), any())).thenReturn(HTTPResponse(200, getStreamLocatorJson)) when(mockHttpUtil.patch(contains(jobConfig.contentV4Update), any(), any())).thenReturn(HTTPResponse(200, getJobJson)) doNothing().when(mockMetrics).incCounter(any()) From c2bd021093bc90a332b800251d53a7fd2ca144b1 Mon Sep 17 00:00:00 2001 From: Kartheek Palla Date: Tue, 18 Jun 2024 12:39:04 +0530 Subject: [PATCH 6/7] Issue KN-1096 test: Azure MKIO project name taking from config --- .../src/main/resources/video-stream-generator.conf | 2 +- video-stream-generator/src/test/resources/test.conf | 2 +- .../sunbird/job/spec/service/VideoStreamServiceTestSpec.scala | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/video-stream-generator/src/main/resources/video-stream-generator.conf b/video-stream-generator/src/main/resources/video-stream-generator.conf index 38a248be5..c758d40ad 100644 --- a/video-stream-generator/src/main/resources/video-stream-generator.conf +++ b/video-stream-generator/src/main/resources/video-stream-generator.conf @@ -60,7 +60,7 @@ azure { } azure_mediakind{ - project_name="subcitionname" + project_name="subscriptionname" auth_token="authToken" account_name="media servcie accountname" api { diff --git a/video-stream-generator/src/test/resources/test.conf b/video-stream-generator/src/test/resources/test.conf index 0e6a338a8..a3ffeac4e 100644 --- a/video-stream-generator/src/test/resources/test.conf +++ b/video-stream-generator/src/test/resources/test.conf @@ -62,7 +62,7 @@ threshold.batch.write.size = 4 } azure_mediakind{ - project_name="subcitionname" + project_name="subscriptionname" auth_token="authToken" account_name="media servcie accountname" api { diff --git a/video-stream-generator/src/test/scala/org/sunbird/job/spec/service/VideoStreamServiceTestSpec.scala b/video-stream-generator/src/test/scala/org/sunbird/job/spec/service/VideoStreamServiceTestSpec.scala index 51d250cdb..9ca159ff1 100644 --- a/video-stream-generator/src/test/scala/org/sunbird/job/spec/service/VideoStreamServiceTestSpec.scala +++ b/video-stream-generator/src/test/scala/org/sunbird/job/spec/service/VideoStreamServiceTestSpec.scala @@ -58,7 +58,7 @@ class VideoStreamServiceTestSpec extends BaseTestSpec { "VideoStreamService" should "submit job request" in { when(mockHttpUtil.post_map(contains("/oauth2/token"), any[Map[String, AnyRef]](), any[Map[String, String]]())).thenReturn(HTTPResponse(200, accessTokenResp)) - when(mockHttpUtil.put(contains("subcitionname/assets/asset-"), anyString(), any())).thenReturn(HTTPResponse(200, assetJson)) + when(mockHttpUtil.put(contains(jobConfig.getConfig("azure_mediakind.project_name")+"/assets/asset-"), anyString(), any())).thenReturn(HTTPResponse(200, assetJson)) when(mockHttpUtil.put(contains("transforms/media_transform_default/jobs"), anyString(), any())).thenReturn(HTTPResponse(200, submitJobJson)) when(mockHttpUtil.get(contains("transforms/media_transform_default/jobs"), any())).thenReturn(HTTPResponse(200, getJobJson)) when(mockHttpUtil.post(contains("/streamingLocators/sl-do_3126597193576939521910_1605816926271/listPaths"), any(), any())).thenReturn(HTTPResponse(200, getStreamUrlJson)) From 6f3aebc95a4839cf637aab710aeb2f857e4d801b Mon Sep 17 00:00:00 2001 From: Kartheek Palla Date: Wed, 19 Jun 2024 14:08:00 +0530 Subject: [PATCH 7/7] Issue KN-1096 fix: removed unused code and veriables --- .../resources/video-stream-generator.conf | 42 ------------------- .../service/AzureMediaService.scala | 27 +----------- .../VideoStreamGeneratorTaskTestSpec.scala | 4 +- .../service/VideoStreamServiceTestSpec.scala | 2 +- 4 files changed, 4 insertions(+), 71 deletions(-) diff --git a/video-stream-generator/src/main/resources/video-stream-generator.conf b/video-stream-generator/src/main/resources/video-stream-generator.conf index c758d40ad..f38d0f433 100644 --- a/video-stream-generator/src/main/resources/video-stream-generator.conf +++ b/video-stream-generator/src/main/resources/video-stream-generator.conf @@ -24,41 +24,6 @@ service { } # Azure Media Service Config -azure { - location = "centralindia" - tenant = "tenant" - subscription_id = "subscription id " - - login { - endpoint="https://login.microsoftonline.com" - } - - api { - endpoint="https://management.azure.com" - version = "2018-07-01" - } - - account_name = "account name" - resource_group_name = "group name" - - transform { - default = "media_transform_default" - hls = "media_transform_hls" - } - - stream { - base_url = "https://sunbirdspikemedia-inct.streaming.media.azure.net" - endpoint_name = "default" - protocol = "Hls" - policy_name = "Predefined_ClearStreamingOnly" - } - - token { - client_key = "client key" - client_secret = "client secret" - } -} - azure_mediakind{ project_name="subscriptionname" auth_token="authToken" @@ -77,13 +42,6 @@ azure_mediakind{ } } -azure_tenant="tenant" -azure_subscription_id="subscription id" -azure_account_name="account name" -azure_resource_group_name="group name" -azure_token_client_key="client key" -azure_token_client_secret="client secret" - # CSP Name. e.g: aws or azure media_service_type="oci" diff --git a/video-stream-generator/src/main/scala/org/sunbird/job/videostream/service/AzureMediaService.scala b/video-stream-generator/src/main/scala/org/sunbird/job/videostream/service/AzureMediaService.scala index 774990630..566d4a42b 100644 --- a/video-stream-generator/src/main/scala/org/sunbird/job/videostream/service/AzureMediaService.scala +++ b/video-stream-generator/src/main/scala/org/sunbird/job/videostream/service/AzureMediaService.scala @@ -13,32 +13,7 @@ import scala.collection.immutable.HashMap abstract class AzureMediaService extends IMediaService { private var API_ACCESS_TOKEN: String = "" - private def getToken()(implicit config: VideoStreamGeneratorConfig, httpUtil: HttpUtil): String = { - val tenant = config.getSystemConfig("azure.tenant") - val clientKey = config.getSystemConfig("azure.token.client_key") - val clientSecret = config.getSystemConfig("azure.token.client_secret") - val loginUrl = config.getConfig("azure.login.endpoint") + "/" + tenant + "/oauth2/token" - - val data = Map[String, String]( - "grant_type" -> "client_credentials", - "client_id" -> clientKey, - "client_secret" -> clientSecret, - "resource" -> "https://management.core.windows.net/" - ) - - val header = Map[String, String]( - "Content-Type" -> "application/x-www-form-urlencoded", - "Keep-Alive" -> "true" - ) - - val response:MediaResponse = Response.getResponse(httpUtil.post_map(loginUrl, data, header)) - if(response.responseCode == "OK"){ - response.result("access_token").asInstanceOf[String] - } else { - throw new Exception("Error while getting the azure access token::"+JSONUtil.serialize(response)) - } - } - + protected def getJobDetails(jobId: String)(implicit config: VideoStreamGeneratorConfig, httpUtil: HttpUtil): MediaResponse = { val url = getApiUrl("job").replace("jobIdentifier", jobId) val response:MediaResponse = Response.getResponse(httpUtil.get(url, getDefaultHeader())) diff --git a/video-stream-generator/src/test/scala/org/sunbird/job/spec/VideoStreamGeneratorTaskTestSpec.scala b/video-stream-generator/src/test/scala/org/sunbird/job/spec/VideoStreamGeneratorTaskTestSpec.scala index cff9e7e32..8ee7580e5 100644 --- a/video-stream-generator/src/test/scala/org/sunbird/job/spec/VideoStreamGeneratorTaskTestSpec.scala +++ b/video-stream-generator/src/test/scala/org/sunbird/job/spec/VideoStreamGeneratorTaskTestSpec.scala @@ -80,8 +80,8 @@ class VideoStreamGeneratorTaskTestSpec extends BaseTestSpec { ignore should "submit a job" in { when(mockKafkaUtil.kafkaJobRequestSource[Event](jobConfig.kafkaInputTopic)).thenReturn(new VideoStreamGeneratorMapSource) - when(mockHttpUtil.post_map(contains("/oauth2/token"), any[Map[String, AnyRef]](), any[Map[String, String]]())).thenReturn(HTTPResponse(200, accessTokenResp)) - when(mockHttpUtil.put(contains("/providers/Microsoft.Media/mediaServices/"+jobConfig.getSystemConfig("azure.account.name")+"/assets/asset-"), anyString(), any())).thenReturn(HTTPResponse(200, assetJson)) + // when(mockHttpUtil.post_map(contains("/oauth2/token"), any[Map[String, AnyRef]](), any[Map[String, String]]())).thenReturn(HTTPResponse(200, accessTokenResp)) + when(mockHttpUtil.put(contains(jobConfig.getConfig("azure_mediakind.project_name")+"/assets/asset-"), anyString(), any())).thenReturn(HTTPResponse(200, assetJson)) when(mockHttpUtil.put(contains("transforms/media_transform_default/jobs"), anyString(), any())).thenReturn(HTTPResponse(200, submitJobJson)) when(mockHttpUtil.get(contains("transforms/media_transform_default/jobs"), any())).thenReturn(HTTPResponse(200, getJobJson)) diff --git a/video-stream-generator/src/test/scala/org/sunbird/job/spec/service/VideoStreamServiceTestSpec.scala b/video-stream-generator/src/test/scala/org/sunbird/job/spec/service/VideoStreamServiceTestSpec.scala index 9ca159ff1..40c1158fc 100644 --- a/video-stream-generator/src/test/scala/org/sunbird/job/spec/service/VideoStreamServiceTestSpec.scala +++ b/video-stream-generator/src/test/scala/org/sunbird/job/spec/service/VideoStreamServiceTestSpec.scala @@ -57,7 +57,7 @@ class VideoStreamServiceTestSpec extends BaseTestSpec { } "VideoStreamService" should "submit job request" in { - when(mockHttpUtil.post_map(contains("/oauth2/token"), any[Map[String, AnyRef]](), any[Map[String, String]]())).thenReturn(HTTPResponse(200, accessTokenResp)) + // when(mockHttpUtil.post_map(contains("/oauth2/token"), any[Map[String, AnyRef]](), any[Map[String, String]]())).thenReturn(HTTPResponse(200, accessTokenResp)) when(mockHttpUtil.put(contains(jobConfig.getConfig("azure_mediakind.project_name")+"/assets/asset-"), anyString(), any())).thenReturn(HTTPResponse(200, assetJson)) when(mockHttpUtil.put(contains("transforms/media_transform_default/jobs"), anyString(), any())).thenReturn(HTTPResponse(200, submitJobJson)) when(mockHttpUtil.get(contains("transforms/media_transform_default/jobs"), any())).thenReturn(HTTPResponse(200, getJobJson))