'undefined' is displayed on whisk.invoke errors
diff --git a/tests/src/system/basic/WskBasicNodeTests.scala b/tests/src/system/basic/WskBasicNodeTests.scala
index 8f1331b..4e5fdca 100644
--- a/tests/src/system/basic/WskBasicNodeTests.scala
+++ b/tests/src/system/basic/WskBasicNodeTests.scala
@@ -156,7 +156,9 @@
activation =>
val result = activation.response.result.get
result.fields.get("activationId") should not be defined
- result.fields.get("error") shouldBe defined
+ result.getFieldPath("error", "message") should be(Some {
+ "Three second rule!".toJson
+ })
val duration = System.currentTimeMillis() - start
duration should be >= expectedDuration.toMillis
@@ -205,7 +207,9 @@
activation =>
val result = activation.response.result.get
result.fields.get("activationId") should not be defined
- result.fields.get("error") shouldBe defined
+ result.getFieldPath("error", "message") should be(Some {
+ "Three second rule!".toJson
+ })
val duration = System.currentTimeMillis() - start
duration should be >= expectedDuration.toMillis
diff --git a/tests/src/system/basic/WskBasicTests.scala b/tests/src/system/basic/WskBasicTests.scala
index e68524b..fcd2b78 100644
--- a/tests/src/system/basic/WskBasicTests.scala
+++ b/tests/src/system/basic/WskBasicTests.scala
@@ -303,7 +303,7 @@
}
wsk.action.invoke(name, blocking = true, expectedExitCode = 246)
- .stderr should include regex (""""error": "name '!' contains illegal characters \(.+\)"""")
+ .stderr should include regex (""""error": "name '!' contains illegal characters \(code \d+\)"""")
}
it should "invoke a blocking action and get only the result" in withAssetCleaner(wskprops) {