Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ryber committed Feb 18, 2024
1 parent d3b75d3 commit 4493624
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ public HeaderValue assertParam(String name, String value) {
public String rawValue() {
return rawValue;
}

public void assertRawValue(String value) {
assertThat(rawValue).isEqualTo(value);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,14 @@ void mediaTypesForParts() {
.field("content", rezInput("/spidey.pdf"), APPLICATION_PDF, "spiderman")
.field("metadata", "{\"foo\": 1}", APPLICATION_JSON)
.asObject(RequestCapture.class)
.ifSuccess(e -> System.out.println(e.getRequestSummary().asString()))
.getBody()
.assertHeader("Content-Type", h ->
h.assertMainValue("multipart/form-data")
.assertHasParam("boundary"))
.assertHeader("Content-Type", h -> {
h.assertMainValue("multipart/form-data");
h.assertHasParam("boundary");
h.assertParam("charset", "UTF-8");
// Lets create a way to tell unirest what the boundary should be so we can test it easier.
//h.assertRawValue("multipart/form-data; boundary=4ebf68bc-70f8-462b-b3a5-48dadb236af3;charset=UTF-8");
})
.assertBodyPart("content", p -> {
p.assertFileName("spiderman");
p.assertContentType("application/pdf");
Expand Down

0 comments on commit 4493624

Please sign in to comment.