I am trying to send an multipart/form-data response in my Citrus HTTP response:
test.$(
http().server("converterServiceServer")
.send()
//Send configured status code
.response(httpStatus)
.message()
.contentType("multipart/form-data; boundary=" + boundary)
.type(MessageType.BINARY)
.body(new ClasspathResource("response.txt"))
);
On client side the image can be extracted from the multipart request, but not be read. But if I read the response.txt file on client side manually, everything works fine.
I think the problem is, that Citrus converts every payload into a string, which corrupts my image file. How can I avoid this?
I tried the following and also to manually set the body by creating a custom Message or a MessagePayloadBuilder, but neither of them works. Citrus still want’s to convert the payload into a string.
My Citrus Version is 4.2 on Java 17 and Springboot 3.2.4