Forum Discussion
Buschfunk
16 years agoFrequent Contributor
Hey,
Thanks for your reply.
Sure, this would work fine. Actually, it does
But the problem is the following: All node values of the mock response are taken from a database. As this list of parameters is pretty long, I'm using an each-statement to iterate through the parameters. And as this list is dynamical, I can't tell in advance if a parameter is a binary (which needs to be base64 encoded) or if it is just a regular string.
Maybe there's a Groovy method to determine if an object is binary?
Cheers,
Robert
Thanks for your reply.
M McDonald wrote:
If you are using the encodeBase64() method in your log output, why are you not using the same when assigning to the context property, like this:context.image = sqlResult['IMAGE'].encodeBase64()
Sure, this would work fine. Actually, it does
But the problem is the following: All node values of the mock response are taken from a database. As this list of parameters is pretty long, I'm using an each-statement to iterate through the parameters. And as this list is dynamical, I can't tell in advance if a parameter is a binary (which needs to be base64 encoded) or if it is just a regular string.Maybe there's a Groovy method to determine if an object is binary?
Cheers,
Robert