mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
change name
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
|
||||
package org.dromara.hutool.core.annotation;
|
||||
|
||||
import org.dromara.hutool.core.annotation.elements.CombinationAnnotatedElement;
|
||||
import org.dromara.hutool.core.array.ArrayUtil;
|
||||
import org.dromara.hutool.core.util.ObjUtil;
|
||||
import lombok.SneakyThrows;
|
||||
@@ -41,7 +42,7 @@ public class AnnotationUtilTest {
|
||||
|
||||
@Test
|
||||
public void testToCombination() {
|
||||
final CombinationAnnotationElement element = AnnotationUtil.toCombination(ClassForTest.class);
|
||||
final CombinationAnnotatedElement element = AnnotationUtil.toCombination(ClassForTest.class);
|
||||
Assertions.assertEquals(2, element.getAnnotations().length);
|
||||
}
|
||||
|
||||
|
@@ -12,25 +12,26 @@
|
||||
|
||||
package org.dromara.hutool.core.annotation;
|
||||
|
||||
import org.dromara.hutool.core.annotation.elements.CombinationAnnotatedElement;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* test for {@link CombinationAnnotationElement}
|
||||
* test for {@link CombinationAnnotatedElement}
|
||||
*/
|
||||
public class CombinationAnnotationElementTest {
|
||||
public class CombinationAnnotatedElementTest {
|
||||
|
||||
@Test
|
||||
public void testOf() {
|
||||
final CombinationAnnotationElement element = CombinationAnnotationElement.of(ClassForTest.class, a -> true);
|
||||
final CombinationAnnotatedElement element = CombinationAnnotatedElement.of(ClassForTest.class, a -> true);
|
||||
Assertions.assertNotNull(element);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsAnnotationPresent() {
|
||||
final CombinationAnnotationElement element = CombinationAnnotationElement.of(ClassForTest.class, a -> true);
|
||||
final CombinationAnnotatedElement element = CombinationAnnotatedElement.of(ClassForTest.class, a -> true);
|
||||
Assertions.assertTrue(element.isAnnotationPresent(MetaAnnotationForTest.class));
|
||||
}
|
||||
|
||||
@@ -38,21 +39,21 @@ public class CombinationAnnotationElementTest {
|
||||
public void testGetAnnotation() {
|
||||
final AnnotationForTest annotation1 = ClassForTest.class.getAnnotation(AnnotationForTest.class);
|
||||
final MetaAnnotationForTest annotation2 = AnnotationForTest.class.getAnnotation(MetaAnnotationForTest.class);
|
||||
final CombinationAnnotationElement element = CombinationAnnotationElement.of(ClassForTest.class, a -> true);
|
||||
final CombinationAnnotatedElement element = CombinationAnnotatedElement.of(ClassForTest.class, a -> true);
|
||||
Assertions.assertEquals(annotation1, element.getAnnotation(AnnotationForTest.class));
|
||||
Assertions.assertEquals(annotation2, element.getAnnotation(MetaAnnotationForTest.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetAnnotations() {
|
||||
final CombinationAnnotationElement element = CombinationAnnotationElement.of(ClassForTest.class, a -> true);
|
||||
final CombinationAnnotatedElement element = CombinationAnnotatedElement.of(ClassForTest.class, a -> true);
|
||||
final Annotation[] annotations = element.getAnnotations();
|
||||
Assertions.assertEquals(2, annotations.length);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetDeclaredAnnotations() {
|
||||
final CombinationAnnotationElement element = CombinationAnnotationElement.of(ClassForTest.class, a -> true);
|
||||
final CombinationAnnotatedElement element = CombinationAnnotatedElement.of(ClassForTest.class, a -> true);
|
||||
final Annotation[] annotations = element.getDeclaredAnnotations();
|
||||
Assertions.assertEquals(2, annotations.length);
|
||||
}
|
@@ -13,6 +13,7 @@
|
||||
package org.dromara.hutool.core.annotation;
|
||||
|
||||
import lombok.SneakyThrows;
|
||||
import org.dromara.hutool.core.annotation.elements.HierarchicalAnnotatedElements;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@@ -12,6 +12,7 @@
|
||||
|
||||
package org.dromara.hutool.core.annotation;
|
||||
|
||||
import org.dromara.hutool.core.annotation.elements.MetaAnnotatedElement;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@@ -12,6 +12,7 @@
|
||||
|
||||
package org.dromara.hutool.core.annotation;
|
||||
|
||||
import org.dromara.hutool.core.annotation.elements.RepeatableMetaAnnotatedElement;
|
||||
import org.dromara.hutool.core.collection.iter.IterUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
Reference in New Issue
Block a user