How do i pause in gatling funspec?

Hi, everyone!

So I have this gatling funspec:

`
//…

spec {
http(“Get access_token”)
.post(tokenUrl)
.formParam(“username”, username)
.formParam(“password”, password)
.formParam(“grant_type”, grantType)
.formParam(“client_id”, clientId)
.check(status.is(200))
.check(jsonPath("$.access_token").saveAs(“token”))
}
// want to wait here
spec {
http(“Returns 403, if token expired”)
.get(authUrl)
.header(“Authorization”, “Bearer ${token}”)
.check(status.is(403))
}
//…

`

I need to pause for 5 seconds after the first spect for token to expire
the only way i found to do so is this:
`
import io.gatling.core.action.builder.PauseBuilder

// …

spec {
new PauseBuilder(5 seconds, None)
}
//…
`

Which is not very readable and probably I’m using it not how it was intended to be used.

disclaimer: this won’t work:

spec { pause(5 seconds) }
because pause returns ChainBuilder, not ActionBuilder