dgrove-oss commented on a change in pull request #3147: Disallow create and
update of package with reserved names.
URL:
https://github.com/apache/incubator-openwhisk/pull/3147#discussion_r159650945
##########
File path:
tests/src/test/scala/whisk/core/controller/test/PackagesApiTests.scala
##########
@@ -371,28 +371,27 @@ class PackagesApiTests extends ControllerTestCommon with
WhiskPackagesApi {
it should "reject create package when package name is a reserved name" in {
implicit val tid = transid()
- RESERVED_NAMES foreach { reservedName =>
- val provider = WhiskPackage(namespace, EntityName(s"$reservedName"),
None)
- val content = WhiskPackagePut()
- Put(s"$collectionPath/${provider.name}", content) ~>
Route.seal(routes(creds)) ~> check {
- status should be(BadRequest)
- val response = responseAs[String]
- response should include {
- Messages.packageNameIsReserved(reservedName)
+ Set(true, false) foreach { overwrite =>
+ RESERVED_NAMES foreach { reservedName =>
+ val provider = WhiskPackage(namespace, EntityName(s"$reservedName"),
None)
+ val content = WhiskPackagePut()
+ Put(s"$collectionPath/${provider.name}?overwrite=$overwrite", content)
~> Route.seal(routes(creds)) ~> check {
+ status should be(BadRequest)
+ val response = responseAs[String]
+ responseAs[ErrorResponse].error shouldBe
Messages.packageNameIsReserved(reservedName)
}
}
}
}
- it should "allow package update even when package name a reserved name" in {
+ it should "not allow package update even when package name is a reserved
name" in {
Review comment:
Nit: "not allow package update when package name is a reserved name"
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services