conn-story Pub Share

Connectors and objects

send::  msg diesel.db.col.mydb.query  (collection="col1")

send::  msg etrieve.status 

expect::  (errcode is 0)

Need to test that the logic for finding the response template works

/$send wiki.content (wpath="AnAuthXmlReq", result="request") /$send snakk.text (url="/diesel/mock/tempus.pspapi", verb="POST", body=request) /$expect (payload contains "TRANRESP")

// $send ctx.set(objsample = snakk.json (url = "/diesel/mock/etrieve.status")) // $send ctx.set(expectedStatus = {

val expectedStatus:JSON={ "buildTimestamp": "2019-04-17T14:57:42-04:00", "serverIp": "10.111.0.39", "source": "ESB.dev", "buildNumber": "1.47", "appDistName": "transprt-1.47", "timestamp": "2019-04-18T20:32:10.854Z", "status": "S" }

/$send snakk.text(url="/diesel/mock/tempus.pspapi", verb="POST", body=request)

Objects and sync calls

// $val objsample = { // msg:"etrieve.status", // type:"request", // 'content-type':"application/json", // verb:"GET", // url:"/diesel/mock/etrieve.status" // }

THIS IS REALLY GOOD BECAUSE It's a direct replacement of dialogues. We can use JSON schema for payload description etc...

when invoking a message synchronously like this, we can just pass a single ovject iwth all the attributesm // $val objsample = snakk.json ({ // msg:"etrieve.status", // type:"request", // 'content-type':"application/json", // verb:"GET", // url:"/diesel/mock/etrieve.status" // }) // sync obj // $val objsample = snakk.json ({ // url:"/diesel/mock/etrieve.status" // }) // sync func // $val objsample = snakk.json (url = "/diesel/mock/etrieve.status") // async func // $send snakk.json (url = "/diesel/mock/etrieve.status") // $send ctx.set(objsample = payload)


Was this useful?    

By: Razie | 2019-10-19 .. 2019-10-23 | Tags: story , dsl


Viewed 923 times ( | History | Print ) this page.

You need to log in to post a comment!

© Copyright DieselApps, 2012-2024, all rights reserved.