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

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


The following commit(s) were added to refs/heads/master by this push:
     new a3a088890a WICKET-7147: reversed order of parameters to `null` check 
methods. (#1097)
a3a088890a is described below

commit a3a088890a4b059134c890b5d47526a90d38fc69
Author: Johan Stuyts <[email protected]>
AuthorDate: Tue Feb 4 12:11:34 2025 +0100

    WICKET-7147: reversed order of parameters to `null` check methods. (#1097)
---
 .../wicket/core/util/tester/WicketTesterTest.java  | 51 +++++++++++-----------
 .../http/OriginResourceIsolationPolicy.java        |  2 +-
 .../wicket/util/tester/BaseWicketTester.java       |  4 +-
 3 files changed, 29 insertions(+), 28 deletions(-)

diff --git 
a/wicket-core-tests/src/test/java/org/apache/wicket/core/util/tester/WicketTesterTest.java
 
b/wicket-core-tests/src/test/java/org/apache/wicket/core/util/tester/WicketTesterTest.java
index e00ad3f05b..c6a73a6afe 100644
--- 
a/wicket-core-tests/src/test/java/org/apache/wicket/core/util/tester/WicketTesterTest.java
+++ 
b/wicket-core-tests/src/test/java/org/apache/wicket/core/util/tester/WicketTesterTest.java
@@ -27,7 +27,6 @@ import static org.junit.jupiter.api.Assertions.fail;
 import java.util.List;
 import java.util.Locale;
 import java.util.concurrent.atomic.AtomicBoolean;
-import jakarta.servlet.http.HttpServletResponse;
 
 import org.apache.wicket.Component;
 import org.apache.wicket.MockPageParametersAware;
@@ -44,6 +43,7 @@ import org.apache.wicket.authorization.IAuthorizationStrategy;
 import org.apache.wicket.core.request.handler.BookmarkablePageRequestHandler;
 import org.apache.wicket.core.request.handler.IPageProvider;
 import org.apache.wicket.core.request.handler.PageProvider;
+import 
org.apache.wicket.core.util.tester.MockPageWithFormAndAjaxFormSubmitBehavior.Pojo;
 import org.apache.wicket.core.util.tester.apps_1.Book;
 import org.apache.wicket.core.util.tester.apps_1.CreateBook;
 import org.apache.wicket.core.util.tester.apps_1.MyMockApplication;
@@ -81,12 +81,13 @@ import org.apache.wicket.util.string.StringValue;
 import org.apache.wicket.util.tester.DummyHomePage;
 import org.apache.wicket.util.tester.DummyHomePage.TestLink;
 import org.apache.wicket.util.tester.FormTester;
-import 
org.apache.wicket.core.util.tester.MockPageWithFormAndAjaxFormSubmitBehavior.Pojo;
 import org.apache.wicket.util.tester.Result;
 import org.apache.wicket.util.tester.WicketTestCase;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
+import jakarta.servlet.http.HttpServletResponse;
+
 /**
  * @see WicketTesterCookieTest for cookie related test
  * @author Juergen Donnerstag
@@ -111,7 +112,7 @@ class WicketTesterTest extends WicketTestCase
        }
 
        /**
-        * 
+        *
         * @throws Exception
         */
        @Test
@@ -128,7 +129,7 @@ class WicketTesterTest extends WicketTestCase
        }
 
        /**
-        * 
+        *
         * @throws Exception
         */
        @Test
@@ -150,7 +151,7 @@ class WicketTesterTest extends WicketTestCase
        }
 
        /**
-        * 
+        *
         * @throws Exception
         */
        @Test
@@ -238,7 +239,7 @@ class WicketTesterTest extends WicketTestCase
 
        /**
         * WICKET-3164
-        * 
+        *
         * @throws Exception
         */
        @Test
@@ -256,13 +257,13 @@ class WicketTesterTest extends WicketTestCase
                }
                catch (AssertionError ex)
                {
-                       ;
+
                }
        }
 
        /**
         * WICKET-3164
-        * 
+        *
         * @throws Exception
         */
        @Test
@@ -280,13 +281,13 @@ class WicketTesterTest extends WicketTestCase
                }
                catch (AssertionError ex)
                {
-                       ;
+
                }
        }
 
        /**
         * WICKET-3152
-        * 
+        *
         * @throws Exception
         */
        @Test
@@ -304,13 +305,13 @@ class WicketTesterTest extends WicketTestCase
                }
                catch (AssertionError ex)
                {
-                       ;
+
                }
        }
 
        /**
         * WICKET-3152
-        * 
+        *
         * @throws Exception
         */
        @Test
@@ -328,13 +329,13 @@ class WicketTesterTest extends WicketTestCase
                }
                catch (AssertionError ex)
                {
-                       ;
+
                }
        }
 
        /**
         * WICKET-3152
-        * 
+        *
         * @throws Exception
         */
        @Test
@@ -357,7 +358,7 @@ class WicketTesterTest extends WicketTestCase
                }
                catch (AssertionError ex)
                {
-                       ;
+
                }
 
                try
@@ -367,7 +368,7 @@ class WicketTesterTest extends WicketTestCase
                }
                catch (AssertionError ex)
                {
-                       ;
+
                }
        }
 
@@ -449,7 +450,7 @@ class WicketTesterTest extends WicketTestCase
 
        /**
         * Test instance constructor and inner page class
-        * 
+        *
         * @throws Exception
         */
        @Test
@@ -692,7 +693,7 @@ class WicketTesterTest extends WicketTestCase
                // executeAjaxEvent weren't submitting the form the name would 
have been
                // reset to null, because the form would have been updated but 
there
                // wouldn't be any data to update it with.
-               assertNotNull("executeAjaxEvent() did not properly submit the 
form", pojo.getName());
+               assertNotNull(pojo.getName(), "executeAjaxEvent() did not 
properly submit the form");
                assertEquals("Mock name", pojo.getName());
        }
 
@@ -973,7 +974,7 @@ class WicketTesterTest extends WicketTestCase
 
        /**
         * <a 
href="https://issues.apache.org/jira/browse/WICKET-3716";>WICKET-3716</a>
-        * 
+        *
         * @throws Exception
         */
        @Test
@@ -1061,7 +1062,7 @@ class WicketTesterTest extends WicketTestCase
 
        /**
         * https://issues.apache.org/jira/browse/WICKET-4437
-        * 
+        *
         * Clicking on ResourceLink should deliver the resource content
         */
        @Test
@@ -1110,7 +1111,7 @@ class WicketTesterTest extends WicketTestCase
 
        /**
         * https://issues.apache.org/jira/browse/WICKET-4507
-        * 
+        *
         * When WicketTester#startComponentInPage() is used then 
#getLastResponseAsString() should
         * return only the component's markup, without the autogenerated markup 
for the page
         */
@@ -1362,15 +1363,15 @@ class WicketTesterTest extends WicketTestCase
        @Test
        void componentInPage() {
                tester.startComponentInPage(Label.class);
-               
+
                tester.assertVisible("");
 
                tester.startComponentInPage(new Label("otherLabel"));
-               
+
                tester.assertVisible("otherLabel");
 
                tester.startComponentInPage(Label.class);
-               
+
                tester.assertVisible("");
        }
 
@@ -1381,5 +1382,5 @@ class WicketTesterTest extends WicketTestCase
                        // redirects to another web server on the same computer
                        throw new 
RedirectToUrlException("http://localhost:4333/";);
                }
-       }       
+       }
 }
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/protocol/http/OriginResourceIsolationPolicy.java
 
b/wicket-core/src/main/java/org/apache/wicket/protocol/http/OriginResourceIsolationPolicy.java
index ab78bc885e..09defb187d 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/protocol/http/OriginResourceIsolationPolicy.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/protocol/http/OriginResourceIsolationPolicy.java
@@ -65,7 +65,7 @@ public class OriginResourceIsolationPolicy implements 
IResourceIsolationPolicy
         */
        public OriginResourceIsolationPolicy addAcceptedOrigin(String 
acceptedOrigin)
        {
-               Checks.notNull("acceptedOrigin", acceptedOrigin);
+               Checks.notNull(acceptedOrigin, "acceptedOrigin");
 
                // strip any leading dot characters
                final int len = acceptedOrigin.length();
diff --git 
a/wicket-tester/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java
 
b/wicket-tester/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java
index 4c409658f0..23769982c5 100644
--- 
a/wicket-tester/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java
+++ 
b/wicket-tester/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java
@@ -2578,7 +2578,7 @@ public class BaseWicketTester
        public String getContentTypeFromResponseHeader()
        {
                String contentType = getLastResponse().getContentType();
-               assertNotNull("No Content-Type header found", contentType);
+               assertNotNull(contentType, "No Content-Type header found");
                return contentType;
        }
 
@@ -2590,7 +2590,7 @@ public class BaseWicketTester
        public int getContentLengthFromResponseHeader()
        {
                String contentLength = 
getLastResponse().getHeader("Content-Length");
-               assertNotNull("No Content-Length header found", contentLength);
+               assertNotNull(contentLength, "No Content-Length header found");
                return Integer.parseInt(contentLength);
        }
 

Reply via email to