use of org.springframework.boot.diagnostics.FailureAnalysis in project spring-boot by spring-projects.
the class BindFailureAnalyzerTests method analysisForValidationExceptionIsNull.
@Test
void analysisForValidationExceptionIsNull() {
FailureAnalysis analysis = performAnalysis(FieldValidationFailureConfiguration.class, "test.foo.value=1");
assertThat(analysis).isNull();
}
use of org.springframework.boot.diagnostics.FailureAnalysis in project spring-boot by spring-projects.
the class BindFailureAnalyzerTests method bindExceptionDueToClassNotFoundConvertionFailure.
// gh-27028
@Test
void bindExceptionDueToClassNotFoundConvertionFailure() {
FailureAnalysis analysis = performAnalysis(GenericFailureConfiguration.class, "test.foo.type=com.example.Missing");
assertThat(analysis.getDescription()).contains(failure("test.foo.type", "com.example.Missing", "\"test.foo.type\" from property source \"test\"", "failed to convert java.lang.String to java.lang.Class<?> (caused by java.lang.ClassNotFoundException: com.example.Missing"));
}
use of org.springframework.boot.diagnostics.FailureAnalysis in project spring-boot by spring-projects.
the class BindFailureAnalyzerTests method bindExceptionDueToOtherFailure.
@Test
void bindExceptionDueToOtherFailure() {
FailureAnalysis analysis = performAnalysis(GenericFailureConfiguration.class, "test.foo.value=alpha");
assertThat(analysis.getDescription()).contains(failure("test.foo.value", "alpha", "\"test.foo.value\" from property source \"test\"", "failed to convert java.lang.String to int"));
}
use of org.springframework.boot.diagnostics.FailureAnalysis in project uhgroupings by uhawaii-system-its-ti-iam.
the class ApiServerHandshakeAnalyzerTest method construction.
@Test
public void construction() {
ApiServerHandshakeAnalyzer analyzer = new ApiServerHandshakeAnalyzer();
assertNotNull(analyzer);
FailureAnalysis fa = analyzer.analyze(null, null);
assertNotNull(fa);
assertThat(fa.getDescription(), startsWith("Could not connect to the API server"));
assertThat(fa.getAction(), startsWith("Start the UH Groupings API"));
}
use of org.springframework.boot.diagnostics.FailureAnalysis in project spring-cloud-open-service-broker by spring-cloud.
the class AbstractServiceBrokerWebAutoConfigurationTest method assertFailureAnalysis.
protected void assertFailureAnalysis(Throwable t) {
FailureAnalyzer analyzer = new RequiredServiceInstanceServiceBeanFailureAnalyzer();
FailureAnalysis analysis = analyzer.analyze(t);
assertThat(analysis).isNotNull();
assertThat(analysis.getDescription()).isEqualTo(ANALYZER_DESCRIPTION);
}
Aggregations