[Question] Massive credentials reading from feeder and encode with Base64 as Authorization: cannot parse from EL expression

Hi all,

I am developing a gatling test where I read from CVS circular feeder the email address (column “username”) and encode the password “1111” with email with Base64 to use as “Authorization” header in form of:

Authorization: AppBasic xxxxx(Base64 encoded "test1@app.com:1111")

Here comes the question: the EL expression “${username}” is not working when I use:


http(Seq(env.base, “authorize”).mkString(":"))
.post(env.base + “/authorize”)
.asJSON // “Accept” and “ContentType” set to JSON
.header(HttpHeaderNames.AcceptCharset, “UTF-8”)
.header(HttpHeaderNames.Authorization, Base64.getEncoder().encodeToString(("${username}" + “:” + “1111”).getBytes()))
jsonPath("$…id_token") exists


Because interpolation in a method seems not to work.

So, I am trying something like:

.header(HttpHeaderNames.Authorization, "${username}".map(username => Base64.getEncoder().encodeToString((username + ":" + "1111").getBytes())))

which leads to a “Vector” of Base64-encoded each letter of the email address, which is not what I want; because “String.map” changes the string into a vector of byte.

So, what can I do here?? Why using the interpolation of EL expression works only out of a function, not inside?