This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-bcel.git
The following commit(s) were added to refs/heads/master by this push: new ce9ebc7e Use assertInstanceOf() ce9ebc7e is described below commit ce9ebc7e33893044970db95a1777b21030e1bb41 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sun Sep 1 18:38:26 2024 -0400 Use assertInstanceOf() --- .../org/apache/bcel/generic/GeneratingAnnotatedClassesTestCase.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/apache/bcel/generic/GeneratingAnnotatedClassesTestCase.java b/src/test/java/org/apache/bcel/generic/GeneratingAnnotatedClassesTestCase.java index c2924d34..8a57699a 100644 --- a/src/test/java/org/apache/bcel/generic/GeneratingAnnotatedClassesTestCase.java +++ b/src/test/java/org/apache/bcel/generic/GeneratingAnnotatedClassesTestCase.java @@ -17,6 +17,7 @@ package org.apache.bcel.generic; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -479,11 +480,11 @@ public class GeneratingAnnotatedClassesTestCase extends AbstractTestCase { assertEquals(1, a.getValues().size(), "Wrong number of values for the annotation"); final ElementValuePairGen nvp = a.getValues().get(0); final ElementValueGen value = nvp.getValue(); - assertTrue(value instanceof ArrayElementValueGen, "Value should be ArrayElementValueGen but is " + value); + assertInstanceOf(ArrayElementValueGen.class, value, "Value should be ArrayElementValueGen but is " + value); final ArrayElementValueGen arrayValue = (ArrayElementValueGen) value; assertEquals(1, arrayValue.getElementValuesSize(), "Wrong size of the array"); final ElementValueGen innerValue = arrayValue.getElementValues().get(0); - assertTrue(innerValue instanceof AnnotationElementValueGen, "Value in the array should be AnnotationElementValueGen but is " + innerValue); + assertInstanceOf(AnnotationElementValueGen.class, innerValue, "Value in the array should be AnnotationElementValueGen but is " + innerValue); final AnnotationElementValueGen innerAnnotationValue = (AnnotationElementValueGen) innerValue; assertEquals("L" + PACKAGE_BASE_SIG + "/data/SimpleAnnotation;", innerAnnotationValue.getAnnotation().getTypeSignature(), "Wrong type signature");