Skip to content

Instantly share code, notes, and snippets.

@dragoonis
Created February 1, 2019 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dragoonis/665343a9ea13eba127416aa8038d1f6f to your computer and use it in GitHub Desktop.
Save dragoonis/665343a9ea13eba127416aa8038d1f6f to your computer and use it in GitHub Desktop.
.doIf(session => session.contains("siriusRandomAssignedClientId")) {
// @todo - > jsonPath($.documents[*].id).findAll.transform.exists, found nothing - if finds nothing, don't error out.
exec(
http("ALL DOCUMENTS FOR A CLIENT")
.get("/api/v1/persons/${siriusRandomAssignedClientId}/documents?limit=999&sort=createdDate:desc,id:desc&filter=draft:0")
.headers(apiHeaders)
.check(status.is(200))
.check(jsonPath("$.documents[*].id")
.ofType[String]
.findAll
.transform(s => util.Random.shuffle(s).apply(0))
.saveAs("siriusRandomDocumentId")
)
)
.exitHereIfFailed
.doIf(session => session.contains("siriusRandomDocumentId")) {
exec(
http("GET DOCUMENT")
.get("/api/document/${siriusRandomDocumentId}/file")
.headers(pdfHeaders)
.check(status.is(200))
)
.exitHereIfFailed
} // /doIf
} // /doIf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment