Test status quo for component name lookups for Jakarta annotations
This commit is contained in:
parent
d8523cb033
commit
aedd909ef6
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -19,6 +19,6 @@ package example.scannable;
|
|||
/**
|
||||
* @author Sam Brannen
|
||||
*/
|
||||
@jakarta.annotation.ManagedBean
|
||||
@jakarta.annotation.ManagedBean("myJakartaManagedBeanComponent")
|
||||
public class JakartaManagedBeanComponent {
|
||||
}
|
||||
|
|
|
@ -22,6 +22,8 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
import example.scannable.DefaultNamedComponent;
|
||||
import example.scannable.JakartaManagedBeanComponent;
|
||||
import example.scannable.JakartaNamedComponent;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition;
|
||||
|
@ -63,6 +65,16 @@ class AnnotationBeanNameGeneratorTests {
|
|||
assertGeneratedName(ComponentWithName.class, "walden");
|
||||
}
|
||||
|
||||
@Test
|
||||
void generateBeanNameWithJakartaNamedComponent() {
|
||||
assertGeneratedName(JakartaNamedComponent.class, "myJakartaNamedComponent");
|
||||
}
|
||||
|
||||
@Test
|
||||
void generateBeanNameWithJakartaManagedBeanComponent() {
|
||||
assertGeneratedName(JakartaManagedBeanComponent.class, "myJakartaManagedBeanComponent");
|
||||
}
|
||||
|
||||
@Test
|
||||
void generateBeanNameWithCustomStereotypeComponent() {
|
||||
assertGeneratedName(DefaultNamedComponent.class, "thoreau");
|
||||
|
|
Loading…
Reference in New Issue