use of org.springframework.boot.diagnostics.FailureAnalysis in project spring-boot by spring-projects.
the class NoSuchBeanDefinitionFailureAnalyzerTests method failureAnalysisForMissingMapType.
@Test
public void failureAnalysisForMissingMapType() throws Exception {
FailureAnalysis analysis = analyzeFailure(createFailure(StringMapConfiguration.class));
assertDescriptionConstructorMissingType(analysis, StringMapHandler.class, 0, String.class);
assertBeanMethodDisabled(analysis, "did not find property 'spring.string.enabled'", TestPropertyAutoConfiguration.class, "string");
assertActionMissingType(analysis, String.class);
}
use of org.springframework.boot.diagnostics.FailureAnalysis in project microservices by pwillhan.
the class ModelMapConfigurationFailureAnalyzer method analyze.
@Override
protected FailureAnalysis analyze(Throwable rootFailure, ConfigurationException cause) {
StringBuilder description = new StringBuilder();
description.append("ModelMapper configuration failed:\n");
for (ErrorMessage message : cause.getErrorMessages()) {
description.append(message.getMessage());
}
return new FailureAnalysis(description.toString(), "Fix ModelMapper configuration", cause);
}
use of org.springframework.boot.diagnostics.FailureAnalysis in project bucket4j-spring-boot-starter by MarcGiffing.
the class Bucket4JAutoConfigFailureAnalyzer method analyze.
@Override
protected FailureAnalysis analyze(Throwable rootFailure, Bucket4jGeneralException cause) {
String descriptionMessage = cause.getMessage();
String actionMessage = cause.getMessage();
if (cause instanceof JCacheNotFoundException) {
JCacheNotFoundException ex = (JCacheNotFoundException) cause;
descriptionMessage = "The cache name name defined in the property is not configured in the caching provider";
actionMessage = "Cache name: " + ex.getCacheName() + newline + "Please configure your caching provider (ehcache, hazelcast, ...)";
}
if (cause instanceof MissingKeyFilterExpressionException) {
descriptionMessage = "You've set the 'filter-key-type' to 'expression' but didn't set the property 'expression'";
actionMessage = "Please set the property 'expression' in your configuration file with a valid expression (see Spring Expression Language)" + newline;
}
return new FailureAnalysis(descriptionMessage, actionMessage, cause);
}
Aggregations