--[[----------------------------------------------------------------------------

WFOzClientTest.lua

--------------------------------------------------------------------------------

ADOBE CONFIDENTIAL
------------------
Copyright 2015 Adobe Systems Incorporated
All Rights Reserved.

NOTICE: All information contained herein is, and remain the property of
Adobe Systems Incorporated and its suppliers, if any. The intellectual and
technical concepts contained herein are proprietary to Adobe Systems
Incorporated and its suppliers and may be covered by U.S. and Foreign
Patents, patents in process, and are protected by trade secret or copyright
law.  Dissemination of this information or reproduction of this material is
strictly forbidden unless prior written permission is obtained from
Adobe Systems Incorporated.

------------------------------------------------------------------------------]]

	-- WF.core.self_test
local WFRxTestCase = require 'WFRxTestCase'

	-- WF.oz_client.account
local WFOzClient = require 'WFOzClient'


--============================================================================--

local WFOzClientTest = {}

--------------------------------------------------------------------------------

function WFOzClientTest.rxTestGetImsAuthUrl_testNightly( rxTest )

	rxTest:setTimeLimit( 10 )

	rxTest:expectSingleValue(

		WFOzClient.getImsAuthUrl( { baseServerUrl = 'https://api.ozstage.com', apiVersion = 'v1.0' } )
			:map( function( authUrl, imsBaseUrl )

				return authUrl, imsBaseUrl,
					   not not authUrl:match( '^https://' ),
					   not not imsBaseUrl:match( '^https://' )

			end ),

		':ignore:', ':ignore:', true, true )

end

--------------------------------------------------------------------------------

function WFOzClientTest.rxTestGetImsAuthUrl_v2_testNightly( rxTest )

	rxTest:setTimeLimit( 10 )

	rxTest:expectSingleValue(

		WFOzClient.getImsAuthUrl { baseServerUrl = 'https://photos-stage.adobe.io', apiVersion = 'v2' }
			:map( function( authUrl, imsBaseUrl )

				return authUrl, imsBaseUrl,
					   not not authUrl:match( '^https://' ),
					   not not imsBaseUrl:match( '^https://' )

			end ),

		':ignore:', ':ignore:', true, true )

end

--------------------------------------------------------------------------------

return WFRxTestCase.wrapSuite( WFOzClientTest )
