Version used of RA: 4.3.0
My request spec:
public static RequestSpecification markLogicRequestSpec(){
return new RequestSpecBuilder()
.setAuth(digest("admin", "admin"))
.setConfig(config().encoderConfig(EncoderConfig.encoderConfig()
.appendDefaultContentCharsetToContentTypeIfUndefined(false)))
.setBaseUri(environment.getMarkLogicUrl())
.addFilter(new AllureRestAssured())
.build();
}
My request:
Asset response =
given().
spec(markLogicRequestSpec()).
contentType("multipart/mixed; boundary=johndoe").
multiPart("file", new File(getTestDataPath("test.png"))).
multiPart("file", new File(getTestDataPath("test.png"))).
when().
post(assetEndPoint).
then().
statusCode(201).
extract().as(Asset.class);
My logged request as a result of the code above:
Request method: POST
Proxy: <none>
Request params: <none>
Query params: <none>
Form params: <none>
Path params: <none>
Headers: Accept=*/*
Content-Type=multipart/mixed; boundary=johndoe
Cookies: <none>
Multiparts: ------------
Content-Disposition: mixed; boundary=johndoe; name = file; filename = test.png
Content-Type: application/octet-stream
testdata/test.png
------------
Content-Disposition: mixed; boundary=johndoe; name = file; filename = test.png
Content-Type: application/octet-stream
testdata/test.png
Body: <none>
I have also tried adding config(RestAssuredConfig.config().multiPartConfig(multiPartConfig().defaultBoundary("abcdef"))). to either my SpecBuilder or in the given of the request, but that didn't change the boundary either.
I need to be able to set my boundary to anything else than just the basic -----------. What else can I try?