You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2021/08/16 10:52:23 UTC

[wicket] branch master updated (8f8ccea -> 866fefc)

This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git.


    from 8f8ccea  Bump SLF4J to 2.0.0-alpha3
     new d22d154  WICKET-6914  Visibility change of "File Upload" via ajax causes "missing" form-data
     new e1930d2  Simplify JUnit assertions
     new 47cf4ff  WICKET-6914 Visibility change of "File Upload" via ajax causes "missing" form-data
     new 866fefc  Explicitly install OpenJDK 11 and Maven

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .travis.yml                                        |  2 +-
 .../http/MultipartFormComponentListener.java       | 52 ++++++++++++++
 .../wicket/protocol/http/WebApplication.java       |  6 +-
 .../wicket/markup/html/form/FormMultiPartTest.java | 20 +++---
 .../wicket/markup/html/form/MultiPartFormPage.java |  4 +-
 .../http/MultipartFormComponentListenerBean.java}  | 63 ++++++-----------
 .../http/MultipartFormComponentListenerPage.html   | 17 +++++
 .../http/MultipartFormComponentListenerPage.java   | 80 ++++++++++++++++++++++
 .../http/MultipartFormComponentListenerTest.java   | 51 ++++++++++++++
 9 files changed, 239 insertions(+), 56 deletions(-)
 create mode 100644 wicket-core/src/main/java/org/apache/wicket/protocol/http/MultipartFormComponentListener.java
 copy wicket-core/src/test/java/org/apache/wicket/{core/util/tester/apps_1/Book.java => protocol/http/MultipartFormComponentListenerBean.java} (58%)
 create mode 100644 wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.html
 create mode 100644 wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.java
 create mode 100644 wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerTest.java

[wicket] 01/04: WICKET-6914 Visibility change of "File Upload" via ajax causes "missing" form-data

Posted by mg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git

commit d22d154ff4d3245df6ecb52cfb00f412b0a25bef
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Mon Aug 16 11:43:36 2021 +0300

    WICKET-6914  Visibility change of "File Upload" via ajax causes "missing" form-data
    
    Update the <form>'s enctype whenever a multipart form component is repainted via Ajax
    
    (cherry picked from commit 06e9f53dbe79a11bf6512263351edc9481dd5619)
---
 .../http/MultipartFormComponentListener.java       | 52 ++++++++++++++
 .../wicket/protocol/http/WebApplication.java       |  6 +-
 .../http/MultipartFormComponentListenerBean.java   | 58 ++++++++++++++++
 .../http/MultipartFormComponentListenerPage.html   | 17 +++++
 .../http/MultipartFormComponentListenerPage.java   | 80 ++++++++++++++++++++++
 .../http/MultipartFormComponentListenerTest.java   | 51 ++++++++++++++
 6 files changed, 262 insertions(+), 2 deletions(-)

diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/MultipartFormComponentListener.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/MultipartFormComponentListener.java
new file mode 100644
index 0000000..f5572ed
--- /dev/null
+++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/MultipartFormComponentListener.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.protocol.http;
+
+import java.util.Map;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.FormComponent;
+import org.apache.wicket.util.visit.IVisitor;
+
+/**
+ * This listener updates the {@link Form}'s <em>enctype</em> whenever a multipart {@link FormComponent}
+ * is added to the {@code AjaxRequestTarget}.
+ * This is needed because the multipart form component may change its visibility/enablement and thus
+ * change the multipart-ness of the whole form.
+ */
+public class MultipartFormComponentListener implements AjaxRequestTarget.IListener
+{
+	static final String ENCTYPE_URL_ENCODED = "application/x-www-form-urlencoded";
+
+	@Override
+	public void onBeforeRespond(final Map<String, Component> map, final AjaxRequestTarget target)
+	{
+		target.getPage().visitChildren(FormComponent.class, (IVisitor<FormComponent<?>, Void>) (formComponent, visit) -> {
+			if (formComponent.isMultiPart())
+			{
+				Form<?> form = formComponent.getForm();
+				boolean multiPart = form.isMultiPart();
+				String enctype = multiPart ? Form.ENCTYPE_MULTIPART_FORM_DATA : ENCTYPE_URL_ENCODED;
+				target.appendJavaScript(String.format("Wicket.$('%s').form.enctype='%s'",
+						formComponent.getMarkupId(), enctype));
+				visit.stop();
+			}
+		});
+	}
+}
diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/WebApplication.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/WebApplication.java
index 1f4df9d..9825038 100644
--- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/WebApplication.java
+++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/WebApplication.java
@@ -758,8 +758,10 @@ public abstract class WebApplication extends Application
 		setSessionStoreProvider(HttpSessionStore::new);
 		setAjaxRequestTargetProvider(AjaxRequestHandler::new);
 
-		getAjaxRequestTargetListeners().add(new AjaxEnclosureListener());
-		
+		AjaxRequestTargetListenerCollection ajaxRequestTargetListeners = getAjaxRequestTargetListeners();
+		ajaxRequestTargetListeners.add(new AjaxEnclosureListener());
+		ajaxRequestTargetListeners.add(new MultipartFormComponentListener());
+
 		// Configure the app.
 		configure();
 		if (getConfigurationType() == RuntimeConfigurationType.DEVELOPMENT)
diff --git a/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerBean.java b/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerBean.java
new file mode 100644
index 0000000..41b6ca4
--- /dev/null
+++ b/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerBean.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.protocol.http;
+
+import java.io.Serializable;
+
+public class MultipartFormComponentListenerBean implements Serializable {
+	private String textField;
+	private String dropDown;
+
+	/**
+	 * @return the textField
+	 */
+	public String getTextField() {
+		return textField;
+	}
+
+
+	/**
+	 * @return the dropDown
+	 */
+	public String getDropDown() {
+		return dropDown;
+	}
+
+
+	/**
+	 * @param textField
+	 *                     the textField to set
+	 */
+	public void setTextField(String textField) {
+		this.textField = textField;
+	}
+
+
+	/**
+	 * @param dropDown
+	 *                    the dropDown to set
+	 */
+	public void setDropDown(String dropDown) {
+		this.dropDown = dropDown;
+	}
+
+}
diff --git a/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.html b/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.html
new file mode 100644
index 0000000..eb741e8
--- /dev/null
+++ b/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html xmlns:wicket="http://wicket.apache.org">
+<head>
+<meta charset="utf-8" />
+<title>Apache Wicket 6914</title>
+</head>
+<body>
+	<form wicket:id="form">
+		<input type="text" wicket:id="textField" /><br/>
+		<select  wicket:id="dropDown"></select><br/>
+		<input wicket:id="fileUpload" type="file" /><br/> 
+		<input type="submit" value="save" wicket:id="submitButton" /><br/><br/><br/>
+	</form>
+	content of textfield or error: <div wicket:id="label"></div>
+	
+</body>
+</html>
diff --git a/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.java b/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.java
new file mode 100644
index 0000000..d0b7842
--- /dev/null
+++ b/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerPage.java
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.protocol.http;
+
+import java.util.ArrayList;
+
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.OnChangeAjaxBehavior;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Button;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.RequiredTextField;
+import org.apache.wicket.markup.html.form.upload.FileUploadField;
+import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.Model;
+
+public class MultipartFormComponentListenerPage extends WebPage {
+	private static final long serialVersionUID = 1L;
+
+	public MultipartFormComponentListenerPage() {
+		CompoundPropertyModel<MultipartFormComponentListenerBean> model = new CompoundPropertyModel<>(new MultipartFormComponentListenerBean());
+		Form<MultipartFormComponentListenerBean> form = new Form<>("form", model);
+		add(form);
+
+		RequiredTextField<String> textField = new RequiredTextField<>("textField");
+		form.add(textField);
+
+		ArrayList<String> list = new ArrayList<>();
+		list.add("Option 1");
+		list.add("Option 2");
+
+		FileUploadField fileUpload = new FileUploadField("fileUpload", new Model<>(new ArrayList<>()));
+		fileUpload.setOutputMarkupPlaceholderTag(true);
+		form.add(fileUpload);
+
+		DropDownChoice<String> dropDown = new DropDownChoice<>("dropDown", list);
+		dropDown.add(new OnChangeAjaxBehavior() {
+
+			@Override
+			protected void onUpdate(AjaxRequestTarget target) {
+				fileUpload.setVisible(!fileUpload.isVisible());
+				target.add(fileUpload);
+
+			}
+		});
+		form.add(dropDown);
+
+		final Label label = new Label("label");
+		add(label);
+
+		form.add(new Button("submitButton") {
+			@Override
+			public void onSubmit() {
+				label.setDefaultModel(new Model<>(model.getObject().getTextField()));
+			}
+
+			@Override
+			public void onError() {
+				label.setDefaultModel(new Model<>("Validation Error..."));
+			}
+		});
+
+	}
+}
diff --git a/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerTest.java b/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerTest.java
new file mode 100644
index 0000000..b5cbf26
--- /dev/null
+++ b/wicket-core/src/test/java/org/apache/wicket/protocol/http/MultipartFormComponentListenerTest.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.protocol.http;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.util.tester.TagTester;
+import org.apache.wicket.util.tester.WicketTestCase;
+import org.junit.jupiter.api.Test;
+
+/**
+ * https://issues.apache.org/jira/browse/WICKET-6914
+ */
+class MultipartFormComponentListenerTest extends WicketTestCase
+{
+    @Test
+    void updateFormEnctype()
+    {
+        tester.startPage(MultipartFormComponentListenerPage.class);
+        tester.assertRenderedPage(MultipartFormComponentListenerPage.class);
+
+        TagTester formTagTester = tester.getTagByWicketId("form");
+        assertEquals(Form.ENCTYPE_MULTIPART_FORM_DATA, formTagTester.getAttribute("enctype"));
+
+        tester.getRequest().setAttribute("form:dropDown", 1);
+        tester.executeAjaxEvent("form:dropDown", "change");
+        String ajaxResponse = tester.getLastResponseAsString();
+        assertTrue(ajaxResponse.contains(".form.enctype='" + MultipartFormComponentListener.ENCTYPE_URL_ENCODED + "'})();"));
+
+        tester.getRequest().setAttribute("form:dropDown", 2);
+        tester.executeAjaxEvent("form:dropDown", "change");
+        ajaxResponse = tester.getLastResponseAsString();
+        assertTrue(ajaxResponse.contains(".form.enctype='" + Form.ENCTYPE_MULTIPART_FORM_DATA + "'})();"));
+    }
+}

[wicket] 04/04: Explicitly install OpenJDK 11 and Maven

Posted by mg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git

commit 866fefc7f81f2ac71c9cd52c1b9602af88405965
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Mon Aug 16 13:51:39 2021 +0300

    Explicitly install OpenJDK 11 and Maven
---
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index 9ba78f6..927a3ff 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -31,7 +31,7 @@ cache:
 
 before_install:
   - lscpu
-  - sudo apt-get install -y chromium-browser fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 [...]
+  - sudo apt-get install -y openjdk-11-jdk maven chromium-browser fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr [...]
   - export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-${TRAVIS_CPU_ARCH}"
   - export PATH="$JAVA_HOME/bin:$PATH"
   - java -version

[wicket] 03/04: WICKET-6914 Visibility change of "File Upload" via ajax causes "missing" form-data

Posted by mg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git

commit 47cf4ff8a44a1b91d2395e4eed639087b6ee2908
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Mon Aug 16 12:17:21 2021 +0300

    WICKET-6914 Visibility change of "File Upload" via ajax causes "missing" form-data
    
    Update test expectations.
    FormComponent#isMultipart() is called now by MultipartFormComponentListener in Ajax requests
    
    (cherry picked from commit f9c98737fb9ed798c9c8cb25e87c3f7f6e87bfb2)
---
 .../java/org/apache/wicket/markup/html/form/FormMultiPartTest.java    | 4 ++--
 .../java/org/apache/wicket/markup/html/form/MultiPartFormPage.java    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/FormMultiPartTest.java b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/FormMultiPartTest.java
index dc6ad3e..85c1419 100644
--- a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/FormMultiPartTest.java
+++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/FormMultiPartTest.java
@@ -77,12 +77,12 @@ class FormMultiPartTest extends WicketTestCase
 
 		page.multiPart = true;
 		tester.executeAjaxEvent(page.button1, "click");
-		assertEquals(2, page.asked);
+		assertEquals(3, page.asked);
 		assertTrue(page.form.isMultiPart());
 
 		page.multiPart = false;
 		tester.executeAjaxEvent(page.button1, "click");
-		assertEquals(3, page.asked);
+		assertEquals(5, page.asked);
 		assertFalse(page.form.isMultiPart());
 	}
 }
diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/MultiPartFormPage.java b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/MultiPartFormPage.java
index 86af382..27de9ae 100644
--- a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/MultiPartFormPage.java
+++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/MultiPartFormPage.java
@@ -49,7 +49,7 @@ public class MultiPartFormPage extends WebPage
 		form = new Form<Void>("form");
 		add(form.setOutputMarkupId(true));
 		
-		input = new TextField<String>("input", Model.of(""))
+		input = new TextField<>("input", Model.of(""))
 		{
 			@Override
 			public boolean isMultiPart() {
@@ -80,4 +80,4 @@ public class MultiPartFormPage extends WebPage
 		};
 		form.add(button2);
 	}
-}
\ No newline at end of file
+}

[wicket] 02/04: Simplify JUnit assertions

Posted by mg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git

commit e1930d22df1796990990ce3f27ae4564e13d5d8c
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Mon Aug 16 12:12:22 2021 +0300

    Simplify JUnit assertions
    
    Non-functional change!
    
    (cherry picked from commit 66b35ade4b3999025e58580bc683e7f7c32cafa9)
---
 .../wicket/markup/html/form/FormMultiPartTest.java       | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/FormMultiPartTest.java b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/FormMultiPartTest.java
index 31a62c3..dc6ad3e 100644
--- a/wicket-core/src/test/java/org/apache/wicket/markup/html/form/FormMultiPartTest.java
+++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/form/FormMultiPartTest.java
@@ -17,6 +17,8 @@
 package org.apache.wicket.markup.html.form;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import org.apache.wicket.util.tester.WicketTestCase;
 import org.junit.jupiter.api.Disabled;
@@ -39,7 +41,7 @@ class FormMultiPartTest extends WicketTestCase
 
 		assertEquals(0, page.asked);
 
-		assertEquals(true, page.form.isMultiPart());
+		assertTrue(page.form.isMultiPart());
 	}
 
 	@Test
@@ -50,17 +52,17 @@ class FormMultiPartTest extends WicketTestCase
 		page.multiPart = false;
 		tester.startPage(page);
 		assertEquals(1, page.asked);
-		assertEquals(false, page.form.isMultiPart());
+		assertFalse(page.form.isMultiPart());
 
 		page.multiPart = true;
 		tester.newFormTester("form").submit(page.button1);
 		assertEquals(2, page.asked);
-		assertEquals(true, page.form.isMultiPart());
+		assertTrue(page.form.isMultiPart());
 
 		page.multiPart = false;
 		tester.newFormTester("form").submit(page.button1);
 		assertEquals(3, page.asked);
-		assertEquals(false, page.form.isMultiPart());
+		assertFalse(page.form.isMultiPart());
 	}
 
 	@Test
@@ -71,16 +73,16 @@ class FormMultiPartTest extends WicketTestCase
 		page.multiPart = false;
 		tester.startPage(page);
 		assertEquals(1, page.asked);
-		assertEquals(false, page.form.isMultiPart());
+		assertFalse(page.form.isMultiPart());
 
 		page.multiPart = true;
 		tester.executeAjaxEvent(page.button1, "click");
 		assertEquals(2, page.asked);
-		assertEquals(true, page.form.isMultiPart());
+		assertTrue(page.form.isMultiPart());
 
 		page.multiPart = false;
 		tester.executeAjaxEvent(page.button1, "click");
 		assertEquals(3, page.asked);
-		assertEquals(false, page.form.isMultiPart());
+		assertFalse(page.form.isMultiPart());
 	}
 }