@@ -109,8 +109,9 @@ abstract class ApiGwCliBasicTests extends BaseApiGwTests {
109109 rr.stdout should include(testbasepath + testrelpath)
110110 }
111111
112- def verifyApiGet (rr : RunResult ): Unit = {
112+ def verifyApiGet (rr : RunResult , apihost : String ): Unit = {
113113 rr.stdout should include regex (s """ "operationId": \\ s+"getPathWithSub_pathsInIt" """ )
114+ rr.stdout should include regex (s """ "target-url": \\ s+"https:// $apihost""" )
114115 }
115116
116117 def verifyApiFullList (rr : RunResult ,
@@ -447,7 +448,7 @@ abstract class ApiGwCliBasicTests extends BaseApiGwTests {
447448 rr = apiList(basepathOrApiName = Some (testbasepath), relpath = Some (testrelpath), operation = Some (testurlop))
448449 verifyApiFullList(rr, clinamespace, actionName, testurlop, testbasepath, testrelpath, testapiname)
449450 rr = apiGet(basepathOrApiName = Some (testbasepath))
450- verifyApiGet(rr)
451+ verifyApiGet(rr, wskprops.apihost )
451452 val deleteresult = apiDelete(basepathOrApiName = testbasepath)
452453 verifyApiDeleted(deleteresult)
453454 } finally {
@@ -456,6 +457,43 @@ abstract class ApiGwCliBasicTests extends BaseApiGwTests {
456457 }
457458 }
458459
460+ it should " verify successful creation and deletion of a new API when apihost specifies the protocol" in {
461+ val testName = " CLI_APIGWTEST2"
462+ val testbasepath = " /" + testName + " _bp"
463+ val testrelpath = " /path/with/sub_paths/in/it"
464+ val testnewrelpath = " /path_new"
465+ val testurlop = " get"
466+ val testapiname = testName + " API Name"
467+ val actionName = testName + " _action"
468+ try {
469+ println(" cli namespace: " + clinamespace)
470+
471+ // Create the action for the API. It must be a "web-action" action.
472+ val file = TestUtils .getTestActionFilename(s " echo.js " )
473+ wsk.action.create(name = actionName, artifact = Some (file), expectedExitCode = createCode, web = Some (" true" ))
474+
475+ val explicitProtocol = if (wskprops.apihost.startsWith(" http" )) " " else " https://"
476+ val wskpropsOverride = WskProps (apihost = explicitProtocol + wskprops.apihost)
477+ var rr = apiCreate(
478+ basepath = Some (testbasepath),
479+ relpath = Some (testrelpath),
480+ operation = Some (testurlop),
481+ action = Some (actionName),
482+ apiname = Some (testapiname))(wskpropsOverride)
483+ verifyApiCreated(rr)
484+ rr = apiList(basepathOrApiName = Some (testbasepath), relpath = Some (testrelpath), operation = Some (testurlop))
485+ verifyApiFullList(rr, clinamespace, actionName, testurlop, testbasepath, testrelpath, testapiname)
486+ rr = apiGet(basepathOrApiName = Some (testbasepath))
487+ verifyApiGet(rr, wskprops.apihost)
488+ val deleteresult = apiDelete(basepathOrApiName = testbasepath)
489+ verifyApiDeleted(deleteresult)
490+ } finally {
491+ wsk.action.delete(name = actionName, expectedExitCode = DONTCARE_EXIT )
492+ apiDelete(basepathOrApiName = testbasepath, expectedExitCode = DONTCARE_EXIT )
493+ }
494+ }
495+
496+
459497 it should " verify get API name " in {
460498 val testName = " CLI_APIGWTEST3"
461499 val testbasepath = " /" + testName + " _bp"
0 commit comments