@@ -69,11 +69,11 @@ abstract class SwiftSDKTests extends TestHelpers with WskTestHelpers with WskAct
69
69
activation.response.success shouldBe true
70
70
71
71
// should have a field named "activationId" which is the date action's activationId
72
- activation.response.result.get.fields(" activationId" ).toString.length should be >= 32
72
+ activation.response.result.get.asJsObject. fields(" activationId" ).toString.length should be >= 32
73
73
74
74
// check for "date" field that comes from invoking the date action
75
75
org.apache.openwhisk.utils.JsHelpers
76
- .fieldPathExists(activation.response.result.get, " response" , " result" , " date" ) should be(true )
76
+ .fieldPathExists(activation.response.result.get.asJsObject , " response" , " result" , " date" ) should be(true )
77
77
}
78
78
}
79
79
@@ -98,10 +98,11 @@ abstract class SwiftSDKTests extends TestHelpers with WskTestHelpers with WskAct
98
98
val run = wsk.action.invoke(actionName, params)
99
99
withActivation(wsk.activation, run, initialWait = 5 seconds, totalWait = activationPollDuration) { activation =>
100
100
// should not have a "response"
101
- org.apache.openwhisk.utils.JsHelpers .fieldPathExists(activation.response.result.get, " response" ) shouldBe false
101
+ org.apache.openwhisk.utils.JsHelpers
102
+ .fieldPathExists(activation.response.result.get.asJsObject, " response" ) shouldBe false
102
103
103
104
// should have a field named "activationId" which is the date action's activationId
104
- activation.response.result.get.fields(" activationId" ).toString.length should be >= 32
105
+ activation.response.result.get.asJsObject. fields(" activationId" ).toString.length should be >= 32
105
106
}
106
107
}
107
108
@@ -146,7 +147,7 @@ abstract class SwiftSDKTests extends TestHelpers with WskTestHelpers with WskAct
146
147
activation.response.success shouldBe true
147
148
148
149
// should have a field named "activationId" which is the date action's activationId
149
- activation.response.result.get.fields(" activationId" ).toString.length should be >= 32
150
+ activation.response.result.get.asJsObject. fields(" activationId" ).toString.length should be >= 32
150
151
151
152
// should result in an activation for triggerName
152
153
val triggerActivations = wsk.activation.pollFor(1 , Some (triggerName), retries = 20 )
@@ -186,7 +187,7 @@ abstract class SwiftSDKTests extends TestHelpers with WskTestHelpers with WskAct
186
187
activation.response.success shouldBe true
187
188
188
189
// should have a field named "name" which is the name of the trigger created
189
- activation.response.result.get.fields(" name" ) shouldBe JsString (triggerName)
190
+ activation.response.result.get.asJsObject. fields(" name" ) shouldBe JsString (triggerName)
190
191
}
191
192
}
192
193
@@ -237,10 +238,16 @@ abstract class SwiftSDKTests extends TestHelpers with WskTestHelpers with WskAct
237
238
activation.response.success shouldBe true
238
239
239
240
// should have a field named "trigger" which is the name of the trigger associated with the rule
240
- activation.response.result.get.fields(" trigger" ).asJsObject.fields(" name" ) shouldBe ruleTriggerName.toJson
241
+ activation.response.result.get.asJsObject
242
+ .fields(" trigger" )
243
+ .asJsObject
244
+ .fields(" name" ) shouldBe ruleTriggerName.toJson
241
245
242
246
// should have a field named "action" which is the name of the action associated with the rule
243
- activation.response.result.get.fields(" action" ).asJsObject.fields(" name" ) shouldBe ruleActionName.toJson
247
+ activation.response.result.get.asJsObject
248
+ .fields(" action" )
249
+ .asJsObject
250
+ .fields(" name" ) shouldBe ruleActionName.toJson
244
251
}
245
252
}
246
253
0 commit comments