zemiles commented on code in PR #1810:
URL: https://github.com/apache/commons-lang/pull/1810#discussion_r4230708141


##########
src/test/java/org/apache/commons/lang3/AnnotationUtilsTest.java:
##########
@@ -470,6 +526,24 @@ void testHashCode() {
         });
     }
 
+    @Test
+    void testHashCodeWithFunction() {
+        final FunctionAnnotation annotation = 
AnnotatedClass.class.getAnnotation(FunctionAnnotation.class);
+        assertEquals(annotation.hashCode(), 
AnnotationUtils.hashCode(annotation));
+    }
+
+    @Test
+    void testHashCodeWithRunnable() {
+        final RunnableAnnotation annotation = 
AnnotatedClass.class.getAnnotation(RunnableAnnotation.class);
+        assertEquals(annotation.hashCode(), 
AnnotationUtils.hashCode(annotation));
+    }
+
+    @Test
+    void testHashCodeWithSupplier() {
+        final SupplierAnnotation annotation = 
AnnotatedClass.class.getAnnotation(SupplierAnnotation.class);
+        assertEquals(annotation.hashCode(), 
AnnotationUtils.hashCode(annotation));
+    }

Review Comment:
   Added testHashCodeWithoutInvokingSupplier() using 
ThrowingSupplierAnnotation. The test fails against the original implementation 
and passes with the fix.
   
   All 22 related tests pass on Java 21, and Checkstyle reports no violations.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to