Ignored test removed (not intended to work)
Issue: SPR-14058
This commit is contained in:
parent
e079a726f8
commit
3c18a4533a
|
@ -54,6 +54,7 @@ public class QualifierAnnotationAutowireContextTests {
|
||||||
|
|
||||||
private static final String SAM = "sam";
|
private static final String SAM = "sam";
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void autowiredFieldWithSingleNonQualifiedCandidate() {
|
public void autowiredFieldWithSingleNonQualifiedCandidate() {
|
||||||
GenericApplicationContext context = new GenericApplicationContext();
|
GenericApplicationContext context = new GenericApplicationContext();
|
||||||
|
@ -312,24 +313,6 @@ public class QualifierAnnotationAutowireContextTests {
|
||||||
assertEquals(JUERGEN, bean.getPerson().getName());
|
assertEquals(JUERGEN, bean.getPerson().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @see SpringBean
|
|
||||||
*/
|
|
||||||
@Test
|
|
||||||
@Ignore("Disabled until SPR-14058 is resolved")
|
|
||||||
public void autowiredFieldResolutionIgnoresEmptyQualifierFromComposedQualifierAnnotation() {
|
|
||||||
GenericApplicationContext context = new GenericApplicationContext();
|
|
||||||
ConstructorArgumentValues cavs1 = new ConstructorArgumentValues();
|
|
||||||
cavs1.addGenericArgumentValue(SAM);
|
|
||||||
RootBeanDefinition person1 = new RootBeanDefinition(Person.class, cavs1, null);
|
|
||||||
context.registerBeanDefinition(SAM, person1);
|
|
||||||
context.registerBeanDefinition("autowired", new RootBeanDefinition(ComposedAnnotationQualifiedFieldTestBean.class));
|
|
||||||
AnnotationConfigUtils.registerAnnotationConfigProcessors(context);
|
|
||||||
context.refresh();
|
|
||||||
ComposedAnnotationQualifiedFieldTestBean bean = context.getBean(ComposedAnnotationQualifiedFieldTestBean.class);
|
|
||||||
assertEquals(SAM, bean.getPerson().getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void autowiredMethodParameterResolvesQualifiedCandidate() {
|
public void autowiredMethodParameterResolvesQualifiedCandidate() {
|
||||||
GenericApplicationContext context = new GenericApplicationContext();
|
GenericApplicationContext context = new GenericApplicationContext();
|
||||||
|
@ -657,37 +640,6 @@ public class QualifierAnnotationAutowireContextTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@code @SpringBean} is a composed annotation that combines the semantics of
|
|
||||||
* {@code Autowired @Autowired} and {@code Qualifier @Qualifier}
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
@Qualifier
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
public @interface SpringBean {
|
|
||||||
|
|
||||||
@AliasFor(annotation = Qualifier.class)
|
|
||||||
String value() default "";
|
|
||||||
|
|
||||||
@AliasFor(annotation = Qualifier.class, attribute = "value")
|
|
||||||
String qualifier() default "";
|
|
||||||
|
|
||||||
@AliasFor(annotation = Autowired.class)
|
|
||||||
boolean required() default true;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class ComposedAnnotationQualifiedFieldTestBean {
|
|
||||||
|
|
||||||
@SpringBean
|
|
||||||
private Person person;
|
|
||||||
|
|
||||||
public Person getPerson() {
|
|
||||||
return this.person;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private static class QualifiedMethodParameterTestBean {
|
private static class QualifiedMethodParameterTestBean {
|
||||||
|
|
||||||
private Person person;
|
private Person person;
|
||||||
|
|
Loading…
Reference in New Issue