Skip to content

Commit

Permalink
Fix some tests the broke due to default change
Browse files Browse the repository at this point in the history
The max attribute size changed in vert.x
  • Loading branch information
stuartwdouglas committed Aug 31, 2021
1 parent fb4c1cb commit a3d5b90
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public JavaArchive get() {
return ShrinkWrap.create(JavaArchive.class)
.addClasses(Resource.class, Data.class)
.addAsResource(new StringAsset(
"quarkus.http.limits.max-form-attribute-size=4K"),
"quarkus.http.limits.max-form-attribute-size=120K"),
"application.properties");
}
});
Expand All @@ -49,6 +49,12 @@ public JavaArchive get() {
@Test
public void test() throws IOException {
String fileContents = new String(Files.readAllBytes(FILE.toPath()), StandardCharsets.UTF_8);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 10; ++i) {
sb.append(fileContents);
}
fileContents = sb.toString();

Assertions.assertTrue(fileContents.length() > HttpServerOptions.DEFAULT_MAX_FORM_ATTRIBUTE_SIZE);
given()
.multiPart("text", fileContents)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,21 @@ public void clearDirectory() {

@Test
public void test() throws IOException {
String formAttrSourceFileContents = new String(Files.readAllBytes(FORM_ATTR_SOURCE_FILE.toPath()),
StandardCharsets.UTF_8);
Assertions.assertTrue(formAttrSourceFileContents.length() > HttpServerOptions.DEFAULT_MAX_FORM_ATTRIBUTE_SIZE);
String fileContents = new String(Files.readAllBytes(FORM_ATTR_SOURCE_FILE.toPath()), StandardCharsets.UTF_8);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 10; ++i) {
sb.append(fileContents);
}
fileContents = sb.toString();
Assertions.assertTrue(fileContents.length() > HttpServerOptions.DEFAULT_MAX_FORM_ATTRIBUTE_SIZE);
given()
.multiPart("active", "true")
.multiPart("num", "25")
.multiPart("status", "WORKING")
.multiPart("htmlFile", HTML_FILE, "text/html")
.multiPart("xmlFile", XML_FILE, "text/xml")
.multiPart("txtFile", TXT_FILE, "text/plain")
.multiPart("name", formAttrSourceFileContents)
.multiPart("name", fileContents)
.accept("text/plain")
.when()
.post("/test")
Expand Down

0 comments on commit a3d5b90

Please sign in to comment.