Gatling test - pdf upload


I am trying to upload a pdf through Gatling test.

My configuration :

val fileName: Expression[String] = "/Users/FormVat51Sample.pdf"
val post =
  .bodyPart(RawFileBodyPart("file", fileName).contentType("application/pdf").fileName("FormVat51Sample.pdf").transferEncoding("binary"))

The Exception I am getting at the server side:

‘org.springframework.web.multipart.MultipartFile’ for property ‘multipartFile’; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [org.springframework.web.multipart.MultipartFile] for property ‘multipartFile’: no matching editors or conversion strategy found]

Please respond.


I am using gatling-core 2.1.7