0

When making an http request using Gatling, the response has the java method getStatusInfo() which returns and object of type StatusType which has a getReasonPhrase() which returns a String.
I'd like to get that reasonPhrase from the response.
How do I do that?
I tried the code below but it complains about the statusInfo:

  /**
    * give the user access 
    *
    * @param session current gatling session
    * @return the serialized body
    */
  def giveAccess(token: String, store: String, testUserUsername: String): ChainBuilder = {
    exec(http("Give Access")
      .post(MY_SERVICE_URI)
      .header(HttpHeaders.AUTHORIZATION, token)
      .header(MyHeaders.STORE, store)
      .headers(defaultHeaders)
      .headers(additionalHeaders)
      .body(StringBody(session => preparePayLoadForGiving(session, testUserUsername)))
      .check(statusInfo.reasonPhrase.is(session => "reason"))
    )
  } 
inor
  • 2,781
  • 2
  • 32
  • 42

1 Answers1

0

I think the fix is to replace:

statusInfo.reasonPhrase

by:

status.reasonPhrase

UBIK LOAD PACK
  • 33,980
  • 5
  • 71
  • 116