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

garydgregory pushed a commit to branch 1.X
in repository https://gitbox.apache.org/repos/asf/commons-beanutils.git


The following commit(s) were added to refs/heads/1.X by this push:
     new 02e0369a Better JUnit API usage
02e0369a is described below

commit 02e0369aaa40aedc78f0ae9327ca5cb3665f2f35
Author: Gary Gregory <[email protected]>
AuthorDate: Mon Jul 27 14:32:48 2026 +0000

    Better JUnit API usage
---
 .../apache/commons/beanutils/DynaPropertyTest.java | 23 +++++++++++-----------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/src/test/java/org/apache/commons/beanutils/DynaPropertyTest.java 
b/src/test/java/org/apache/commons/beanutils/DynaPropertyTest.java
index 682d55f3..3dee48e8 100644
--- a/src/test/java/org/apache/commons/beanutils/DynaPropertyTest.java
+++ b/src/test/java/org/apache/commons/beanutils/DynaPropertyTest.java
@@ -14,21 +14,28 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.beanutils;
 
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
 import java.util.Collection;
 
 import junit.framework.TestCase;
 
 /**
  * Test case for {@link DynaProperty}.
- *
  */
 public class DynaPropertyTest extends TestCase {
+
     private DynaProperty testPropertyWithName;
+
     private DynaProperty testProperty1Duplicate;
+
     private DynaProperty testPropertyWithNameAndType;
+
     private DynaProperty testProperty2Duplicate;
+
     private DynaProperty testPropertyWithNameAndTypeAndContentType;
 
     private DynaProperty testProperty3Duplicate;
@@ -47,15 +54,11 @@ public class DynaPropertyTest extends TestCase {
      */
     @Override
     protected void setUp() throws Exception {
-
         super.setUp();
-
         testPropertyWithName = new DynaProperty("test1");
         testProperty1Duplicate = new DynaProperty("test1");
-
         testPropertyWithNameAndType = new DynaProperty("test2", Integer.class);
         testProperty2Duplicate = new DynaProperty("test2", Integer.class);
-
         testPropertyWithNameAndTypeAndContentType = new DynaProperty("test3", 
Collection.class, Short.class);
         testProperty3Duplicate = new DynaProperty("test3", Collection.class, 
Short.class);
     }
@@ -65,7 +68,6 @@ public class DynaPropertyTest extends TestCase {
      */
     @Override
     protected void tearDown() throws Exception {
-
         testPropertyWithName = testProperty1Duplicate = null;
         testPropertyWithNameAndType = testProperty2Duplicate = null;
         testPropertyWithNameAndTypeAndContentType = testProperty3Duplicate = 
null;
@@ -76,25 +78,22 @@ public class DynaPropertyTest extends TestCase {
      * Class under test for boolean equals(Object)
      */
     public void testEqualsObject() {
-
         assertEquals(testPropertyWithName, testProperty1Duplicate);
         assertEquals(testPropertyWithNameAndType, testProperty2Duplicate);
         assertEquals(testPropertyWithNameAndTypeAndContentType, 
testProperty3Duplicate);
-        assertFalse(testPropertyWithName.equals(testPropertyWithNameAndType));
-        
assertFalse(testPropertyWithNameAndType.equals(testPropertyWithNameAndTypeAndContentType));
-        assertFalse(testPropertyWithName.equals(null));
+        assertNotEquals(testPropertyWithName, testPropertyWithNameAndType);
+        assertNotEquals(testPropertyWithNameAndType, 
testPropertyWithNameAndTypeAndContentType);
+        assertNotNull(testPropertyWithName);
     }
 
     /**
      * Class under test for int hashCode(Object)
      */
     public void testHashCode() {
-
         final int initialHashCode = 
testPropertyWithNameAndTypeAndContentType.hashCode();
         assertEquals(testPropertyWithName.hashCode(), 
testProperty1Duplicate.hashCode());
         assertEquals(testPropertyWithNameAndType.hashCode(), 
testProperty2Duplicate.hashCode());
         assertEquals(testPropertyWithNameAndTypeAndContentType.hashCode(), 
testProperty3Duplicate.hashCode());
         assertEquals(initialHashCode, 
testPropertyWithNameAndTypeAndContentType.hashCode());
     }
-
 }

Reply via email to