You might come across the same question on stackoverflow. However, i’d come to realize this might be a better medium to ask this question since it is quite specific.
I have a situation where my response is encrypted. In order to decrypt it, I need to get hold of the
session because there are some variables on the
session that are needed to decrypt.
So far I have seen 2 options to transform a responsebody but none of them works for me:
.check(status.is(200)) .transformResponse(/* return something here */) .check(jsonPath(/*..*/).is(..))
Unfortunately, I can’t get the
session in this method. Thus i’m not able to decrypt it.
.check(status.is(200)) .check(bodyString.transform((body, session) => /* decrypt it*/).is(/*..*/))
This allows me to decrypt it, but the bodyString.transform returns a plain
CheckBuilder that has few operations on it. Only simple ones like ‘is’ , ‘greaterThan’ etc. This does not make it really fluent so I can do multiple ‘jsonPath’ assertions/checks in series. Also I don’t want to decrypt it for every .check()
So my final question is: Is there some way that allows me to decrypt the response (can only be decrypted with variables on the session), and use multiple ‘jsonPath’ assertions? If I can extend anything or create something myself please let me know. (and preferably some hints because i’m not really good at scala)
If anybody can come up with some hack to decrypt it (with variables from the session) in .transformResponse()…i’m up for it.