Dependency tracking for Supplier-created beans

Issue: SPR-15417
This commit is contained in:
Juergen Hoeller
2017-04-07 18:01:28 +02:00
parent ea5cb26d75
commit a95843a068
2 changed files with 66 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.
@@ -156,6 +156,11 @@ public class AnnotationConfigApplicationContextTests {
assertSame(context.getBean(BeanB.class), context.getBean(BeanA.class).b);
assertSame(context.getBean(BeanC.class), context.getBean(BeanA.class).c);
assertSame(context, context.getBean(BeanB.class).applicationContext);
assertArrayEquals(new String[] {"annotationConfigApplicationContextTests.BeanA"},
context.getDefaultListableBeanFactory().getDependentBeans("annotationConfigApplicationContextTests.BeanB"));
assertArrayEquals(new String[] {"annotationConfigApplicationContextTests.BeanA"},
context.getDefaultListableBeanFactory().getDependentBeans("annotationConfigApplicationContextTests.BeanC"));
}
@Test