mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
优化代码,调整变量、方法与类名,完善测试用例
This commit is contained in:
@@ -12,11 +12,11 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.UnaryOperator;
|
||||
|
||||
public class AliasAttributePostProcessorTest {
|
||||
public class AliasAnnotationPostProcessorTest {
|
||||
|
||||
@Test
|
||||
public void processTest() {
|
||||
AliasAttributePostProcessor processor = new AliasAttributePostProcessor();
|
||||
AliasAnnotationPostProcessor processor = new AliasAnnotationPostProcessor();
|
||||
|
||||
Map<Class<?>, SynthesizedAnnotation> annotationMap = new HashMap<>();
|
||||
SynthesizedAnnotationAggregator synthesizedAnnotationAggregator = new TestSynthesizedAnnotationAggregator(annotationMap);
|
@@ -12,11 +12,11 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.UnaryOperator;
|
||||
|
||||
public class AliasForLinkAttributePostProcessorTest {
|
||||
public class AliasLinkAnnotationPostProcessorTest {
|
||||
|
||||
@Test
|
||||
public void processForceAliasForTest() {
|
||||
AliasForLinkAttributePostProcessor processor = new AliasForLinkAttributePostProcessor();
|
||||
AliasLinkAnnotationPostProcessor processor = new AliasLinkAnnotationPostProcessor();
|
||||
|
||||
Map<Class<?>, SynthesizedAnnotation> annotationMap = new HashMap<>();
|
||||
SynthesizedAnnotationAggregator synthesizedAnnotationAggregator = new TestSynthesizedAnnotationAggregator(annotationMap);
|
||||
@@ -40,7 +40,7 @@ public class AliasForLinkAttributePostProcessorTest {
|
||||
|
||||
@Test
|
||||
public void processAliasForTest() {
|
||||
AliasForLinkAttributePostProcessor processor = new AliasForLinkAttributePostProcessor();
|
||||
AliasLinkAnnotationPostProcessor processor = new AliasLinkAnnotationPostProcessor();
|
||||
|
||||
Map<Class<?>, SynthesizedAnnotation> annotationMap = new HashMap<>();
|
||||
SynthesizedAnnotationAggregator synthesizedAnnotationAggregator = new TestSynthesizedAnnotationAggregator(annotationMap);
|
@@ -12,11 +12,11 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.UnaryOperator;
|
||||
|
||||
public class MirrorLinkAttributePostProcessorTest {
|
||||
public class MirrorLinkAnnotationPostProcessorTest {
|
||||
|
||||
@Test
|
||||
public void processTest() {
|
||||
MirrorLinkAttributePostProcessor processor = new MirrorLinkAttributePostProcessor();
|
||||
MirrorLinkAnnotationPostProcessor processor = new MirrorLinkAnnotationPostProcessor();
|
||||
|
||||
Map<Class<?>, SynthesizedAnnotation> annotationMap = new HashMap<>();
|
||||
SynthesizedAnnotationAggregator synthesizedAnnotationAggregator = new TestSynthesizedAnnotationAggregator(annotationMap);
|
@@ -36,7 +36,7 @@ public class TypeAnnotationScannerTest {
|
||||
annotations.forEach(a -> Assert.assertEquals(a.annotationType(), AnnotationForScannerTest.class));
|
||||
|
||||
// 不查找父类
|
||||
scanner = new TypeAnnotationScanner().setIncludeSupperClass(false);
|
||||
scanner = new TypeAnnotationScanner().setIncludeSuperClass(false);
|
||||
annotations = scanner.getAnnotations(Example.class);
|
||||
Assert.assertEquals(1, annotations.size());
|
||||
annotations.forEach(a -> Assert.assertEquals(a.annotationType(), AnnotationForScannerTest.class));
|
||||
@@ -88,7 +88,7 @@ public class TypeAnnotationScannerTest {
|
||||
// 不查找父类
|
||||
map.clear();
|
||||
new TypeAnnotationScanner()
|
||||
.setIncludeSupperClass(false)
|
||||
.setIncludeSuperClass(false)
|
||||
.scan(
|
||||
(index, annotation) -> map.computeIfAbsent(index, i -> new ArrayList<>()).add(annotation),
|
||||
Example.class, null
|
||||
|
Reference in New Issue
Block a user