use of cn.taketoday.framework.diagnostics.FailureAnalysis in project today-infrastructure by TAKETODAY.
the class IncompatibleConfigurationFailureAnalyzerTests method incompatibleConfigurationListsKeys.
@Test
void incompatibleConfigurationListsKeys() {
FailureAnalysis failureAnalysis = performAnalysis("spring.first.key", "spring.second.key");
assertThat(failureAnalysis.getDescription()).contains("The following configuration properties have incompatible values: [spring.first.key, spring.second.key]");
assertThat(failureAnalysis.getAction()).contains("Review the docs for spring.first.key, spring.second.key and change the configured values.");
}
use of cn.taketoday.framework.diagnostics.FailureAnalysis in project today-infrastructure by TAKETODAY.
the class ConfigDataNotFoundFailureAnalyzerTests method analyzeWhenOptionalConfigDataLocationNotFoundException.
@Test
void analyzeWhenOptionalConfigDataLocationNotFoundException() {
ConfigDataLocation location = ConfigDataLocation.valueOf("optional:test");
ConfigDataLocationNotFoundException exception = new ConfigDataLocationNotFoundException(location);
FailureAnalysis result = this.analyzer.analyze(exception);
assertThat(result.getDescription()).isEqualTo("Config data location 'optional:test' does not exist");
assertThat(result.getAction()).isEqualTo("Check that the value 'optional:test' is correct");
}
use of cn.taketoday.framework.diagnostics.FailureAnalysis in project today-infrastructure by TAKETODAY.
the class BeanCurrentlyInCreationFailureAnalyzerTests method cycleWithCircularReferencesAllowed.
@Test
void cycleWithCircularReferencesAllowed() throws IOException {
FailureAnalysis analysis = performAnalysis(CyclicBeanMethodsConfiguration.class, true);
assertThat(analysis.getAction()).contains("Despite circular references being allowed");
}
use of cn.taketoday.framework.diagnostics.FailureAnalysis in project today-infrastructure by TAKETODAY.
the class BeanCurrentlyInCreationFailureAnalyzerTests method testSelfReferenceCycle.
@Test
void testSelfReferenceCycle() throws IOException {
FailureAnalysis analysis = performAnalysis(SelfReferenceBeanConfiguration.class);
List<String> lines = readDescriptionLines(analysis);
assertThat(lines).hasSize(5);
assertThat(lines.get(0)).isEqualTo("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("| bean defined in " + SelfReferenceBeanConfiguration.class.getName());
assertThat(lines.get(4)).isEqualTo("└──<-──┘");
assertThat(analysis.getAction()).isNotNull();
}
use of cn.taketoday.framework.diagnostics.FailureAnalysis in project today-infrastructure by TAKETODAY.
the class BeanCurrentlyInCreationFailureAnalyzerTests method cycleWithCircularReferencesProhibited.
@Test
void cycleWithCircularReferencesProhibited() throws IOException {
FailureAnalysis analysis = performAnalysis(CyclicBeanMethodsConfiguration.class, false);
assertThat(analysis.getAction()).contains("As a last resort");
}
Aggregations