I can not figure out, how to write the Rest Test. Please help me out.
I have a RestService:
@POST
@Path("/insertDataInDB")
@Consumes(MediaType.MULTIPART_FORM_DATA)
public Response insertDataInDB(@FormDataParam("inputfile")
MultipartFormDataInput inputfile) {
do Stuff
}
The Service works, i tested it with Chromes Rest Console.
Request URI:
http://localhost:8080/persDB/rest/r/insertDataInDB
Content Type:
multipart/form-data
Attachements Files:
Test.xlsx
Parameter Key:
inputfile
How does the Rest Test look? I tried this
But i can't quite figure it out, where to put the parameter key etc.
@HttpTest(method = Method.POST, path = "persDB/rest/r/insertDataInDB", content = "{}", type = MediaType.MULTIPART_FORM_DATA, file = "inputfile.xlsx")
public void insertDataInDB() {
do Stuff
}
and i'm getting a java.io.IOException:
2014-02-04 16:01:30,825 [http-/0.0.0.0:8080-2] SEVERE org.jboss.resteasy.core.SynchronousDispatcher - Failed executing POST r/insertDataInDB: org.jboss.resteasy.spi.ReaderException: java.io.IOException: Unable to get boundary for multipart