Make cycle clearer in bean currently in creation failure analysis
Note: the fully-qualified references to @Configuration in some of the
test configuration classes are required to work around a bug in javac.
1.8.0_102 (and earlier). Without them, compilation fails as it cannot
resolve the symbol despite the import statement and the unqualified
references working elsewhere in the same source file.
Closes gh-7056
@ -39,10 +49,25 @@ public class BeanCurrentlyInCreationFailureAnalyzerTests {
@@ -39,10 +49,25 @@ public class BeanCurrentlyInCreationFailureAnalyzerTests {
"The dependencies of some of the beans in the application context form a cycle:");
assertThat(lines.get(1)).isEqualTo("");
assertThat(lines.get(2)).isEqualTo("┌─────┐");
assertThat(lines.get(3)).startsWith(
"| one defined in "+InnerInnerConfiguration.class.getName());
assertThat(lines.get(4)).isEqualTo("↑ ↓");
assertThat(lines.get(5))
.startsWith("| two defined in "+InnerConfiguration.class.getName());
assertThat(lines.get(6)).isEqualTo("↑ ↓");
assertThat(lines.get(7)).startsWith(
"| three defined in "+CyclicBeanMethodsConfiguration.class.getName());
assertThat(lines.get(8)).isEqualTo("└─────┘");
assertThat(analysis.getDescription()).startsWith(
"There is a circular dependency between 3 beans in the application context:");
"The dependencies of some of the beans in the application context form a cycle:");
assertThat(analysis.getDescription()).contains(
"one defined in "+CyclicBeanMethodsConfiguration.class.getName());
assertThat(analysis.getDescription()).contains(
@ -52,22 +77,74 @@ public class BeanCurrentlyInCreationFailureAnalyzerTests {
@@ -52,22 +77,74 @@ public class BeanCurrentlyInCreationFailureAnalyzerTests {
@ -89,9 +166,39 @@ public class BeanCurrentlyInCreationFailureAnalyzerTests {
@@ -89,9 +166,39 @@ public class BeanCurrentlyInCreationFailureAnalyzerTests {
@ -103,13 +210,33 @@ public class BeanCurrentlyInCreationFailureAnalyzerTests {
@@ -103,13 +210,33 @@ public class BeanCurrentlyInCreationFailureAnalyzerTests {
@ -127,6 +254,7 @@ public class BeanCurrentlyInCreationFailureAnalyzerTests {
@@ -127,6 +254,7 @@ public class BeanCurrentlyInCreationFailureAnalyzerTests {
publicBeanTwotwo(){
returnnewBeanTwo();
}
}
publicstaticclassBeanThreeConfiguration{
@ -135,10 +263,25 @@ public class BeanCurrentlyInCreationFailureAnalyzerTests {
@@ -135,10 +263,25 @@ public class BeanCurrentlyInCreationFailureAnalyzerTests {