pm.test("Response is OK", function () {
pm.response.to.have.status(200);
});
pm.test("Response should be okay to process.", function () {
pm.response.to.not.be.error;
pm.response.to.not.have.jsonBody("error");
});
pm.test("Response has session token", function () {
pm.response.to.have.jsonBody("SessionToken");
});
pm.test("Next step code is ANCQ", function () {
pm.expect(pm.response.text()).to.include("ANCQ");
});
var sessionToken = pm.environment.get("SessionToken");
var userToken = pm.environment.get("UserToken");
var cuid = pm.environment.get("cuid");
var sproc = "CALL PROJ50415.PUT_PIB_LOGS('@token', '@userToken', '@creditUnionId', 'AUT');";
sproc = sproc.replace("@token", sessionToken);
sproc = sproc.replace("@userToken", userToken);
sproc = sproc.replace("@creditUnionId", cuid);
postman.setEnvironmentVariable("LastSprocCall", sproc);
var sequenceNumber = pm.request.url.path[2];
var query = "SELECT * FROM FILEET.SMMBRMDT WHERE SDACCTBS = '958' AND SDCORPID = '1' AND SDHSEQNUM = '@sequence'";
query = query.replace("@sequence", sequenceNumber);
postman.setEnvironmentVariable("LastTableQuery", query);
var jsonData = JSON.parse(responseBody);
postman.setEnvironmentVariable("SessionToken", jsonData.SessionToken);
postman.setEnvironmentVariable("UserToken", jsonData.UserToken);