Skip to content

Commit 6fffec7

Browse files
mdeuserVincent
authored andcommitted
Better error controller message for authorization failure (#2877)
* Add resource name to Forbidden error message * Comment updates and test case updates * Fix scalafmt issue * Reformat using scalafmt plugin * Fix two more failing test cases * Comment updates * Compiles but tests are broken * Add Set[Resources] test * Comment updates * Comment updates
1 parent d29bd3c commit 6fffec7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tests/src/test/scala/system/basic/WskBasicTests.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ import spray.json._
3636
import spray.json.DefaultJsonProtocol._
3737
import spray.json.pimpAny
3838

39+
import whisk.http.Messages
40+
3941
@RunWith(classOf[JUnitRunner])
4042
class WskBasicTests extends TestHelpers with WskTestHelpers {
4143

@@ -168,8 +170,9 @@ class WskBasicTests extends TestHelpers with WskTestHelpers {
168170

169171
it should "reject get of package that does not exist" in {
170172
val name = "nonexistentPackage"
173+
val ns = wsk.namespace.whois()
171174
val stderr = wsk.pkg.get(name, expectedExitCode = NOT_FOUND).stderr
172-
stderr should include regex (s"""Unable to get package '$name': The requested resource does not exist. \\(code \\d+\\)""")
175+
stderr should include regex (s"""Unable to get package '$name': ${Messages.resourceDoesntExist(s"${ns}/${name}")} \\(code \\d+\\)""")
173176
}
174177

175178
behavior of "Wsk Action CLI"

0 commit comments

Comments
 (0)