@@ -575,8 +575,13 @@ class ActionsApiTests extends ControllerTestCommon with WhiskActionsApi {
575575 response should be(action3)
576576 }
577577
578- // it should delete all actions if version is not specified
578+ // it should return 403 error when try to delete multi versions without specify deleteAll=true
579579 Delete (s " $collectionPath/ ${action.name}" ) ~> Route .seal(routes(creds)) ~> check {
580+ status should be(Forbidden )
581+ }
582+
583+ // it should delete all actions if version is not specified and deleteAll is passed as true
584+ Delete (s " $collectionPath/ ${action.name}?deleteAll=true " ) ~> Route .seal(routes(creds)) ~> check {
580585 status should be(OK )
581586 val response = responseAs[WhiskAction ]
582587 response should be(action3)
@@ -951,7 +956,8 @@ class ActionsApiTests extends ControllerTestCommon with WhiskActionsApi {
951956 Some (action.limits.timeout),
952957 Some (action.limits.memory),
953958 Some (action.limits.logs),
954- Some (action.limits.concurrency))))
959+ Some (action.limits.concurrency))),
960+ Some (action.version))
955961
956962 // first request invalidates any previous entries and caches new result
957963 Put (s " $collectionPath/ ${action.name}" , content) ~> Route .seal(routes(creds)(transid())) ~> check {
@@ -1004,12 +1010,12 @@ class ActionsApiTests extends ControllerTestCommon with WhiskActionsApi {
10041010 action.exec,
10051011 action.parameters,
10061012 action.limits,
1007- action.version.upPatch ,
1013+ action.version,
10081014 action.publish,
10091015 action.annotations ++ systemAnnotations(kind)))
10101016 }
10111017 stream.toString should include(s " entity exists, will try to update ' $action' " )
1012- stream.toString should include(s " caching ${CacheKey (action.copy(version = action.version.upPatch) )}" )
1018+ stream.toString should include(s " caching ${CacheKey (action)}" )
10131019 stream.reset()
10141020
10151021 // delete should invalidate cache for all versions
@@ -1024,12 +1030,11 @@ class ActionsApiTests extends ControllerTestCommon with WhiskActionsApi {
10241030 action.exec,
10251031 action.parameters,
10261032 action.limits,
1027- action.version.upPatch ,
1033+ action.version,
10281034 action.publish,
10291035 action.annotations ++ systemAnnotations(kind)))
10301036 }
10311037 stream.toString should include(s " invalidating ${CacheKey (action)}" )
1032- stream.toString should include(s " invalidating ${CacheKey (action.copy(version = action.version.upPatch))}" )
10331038 stream.reset()
10341039 }
10351040 }
@@ -1343,7 +1348,8 @@ class ActionsApiTests extends ControllerTestCommon with WhiskActionsApi {
13431348 Some (action.limits.timeout),
13441349 Some (action.limits.memory),
13451350 Some (action.limits.logs),
1346- Some (action.limits.concurrency))))
1351+ Some (action.limits.concurrency))),
1352+ Some (action.version))
13471353 val name = action.name
13481354 val cacheKey = s " ${CacheKey (action)}" .replace(" (" , " \\ (" ).replace(" )" , " \\ )" )
13491355 val expectedPutLog =
@@ -1369,7 +1375,7 @@ class ActionsApiTests extends ControllerTestCommon with WhiskActionsApi {
13691375 action.exec,
13701376 action.parameters,
13711377 action.limits,
1372- action.version.upPatch ,
1378+ action.version,
13731379 action.publish,
13741380 action.annotations ++ systemAnnotations(kind)))
13751381 }
@@ -1388,7 +1394,7 @@ class ActionsApiTests extends ControllerTestCommon with WhiskActionsApi {
13881394 action.exec,
13891395 action.parameters,
13901396 action.limits,
1391- action.version.upPatch ,
1397+ action.version,
13921398 action.publish,
13931399 action.annotations ++ systemAnnotations(kind)))
13941400 }
@@ -1410,7 +1416,8 @@ class ActionsApiTests extends ControllerTestCommon with WhiskActionsApi {
14101416 Some (actionOldSchema.limits.timeout),
14111417 Some (actionOldSchema.limits.memory),
14121418 Some (actionOldSchema.limits.logs),
1413- Some (actionOldSchema.limits.concurrency))))
1419+ Some (actionOldSchema.limits.concurrency))),
1420+ Some (actionOldSchema.version))
14141421 val expectedPutLog =
14151422 Seq (s " uploading attachment '[ \\ w-/:]+' of document 'id: ${actionOldSchema.namespace}/ ${actionOldSchema.name}" )
14161423 .mkString(" (?s).*" )
@@ -1436,7 +1443,7 @@ class ActionsApiTests extends ControllerTestCommon with WhiskActionsApi {
14361443 actionNewSchema.exec,
14371444 actionOldSchema.parameters,
14381445 actionOldSchema.limits,
1439- actionOldSchema.version.upPatch ,
1446+ actionOldSchema.version,
14401447 actionOldSchema.publish,
14411448 actionOldSchema.annotations ++ systemAnnotations(NODEJS10 , create = false )))
14421449 }
@@ -1461,7 +1468,7 @@ class ActionsApiTests extends ControllerTestCommon with WhiskActionsApi {
14611468 actionNewSchema.exec,
14621469 actionOldSchema.parameters,
14631470 actionOldSchema.limits,
1464- actionOldSchema.version.upPatch ,
1471+ actionOldSchema.version,
14651472 actionOldSchema.publish,
14661473 actionOldSchema.annotations ++ systemAnnotations(NODEJS10 , create = false )))
14671474 }
0 commit comments