Polish "Handle new Annotation.toString() behaviour in JDK 14"

See gh-20180
pull/20417/head
Stephane Nicoll 5 years ago
parent e22aca85e9
commit e5394ceac2

@ -154,11 +154,14 @@ class NoSuchBeanDefinitionFailureAnalyzerTests {
@Test
void failureAnalysisForUnmatchedQualifier() {
FailureAnalysis analysis = analyzeFailure(createFailure(QualifiedBeanConfiguration.class));
String pattern = "@org.springframework.beans.factory.annotation.Qualifier\\(value=\"*alpha\"*\\)";
assertThat(analysis.getDescription()).containsPattern(determineAnnotationValuePattern());
}
private String determineAnnotationValuePattern() {
if (JavaVersion.getJavaVersion().isEqualOrNewerThan(JavaVersion.FOURTEEN)) {
pattern = "@org.springframework.beans.factory.annotation.Qualifier\\(\"*alpha\"*\\)";
return "@org.springframework.beans.factory.annotation.Qualifier\\(\"*alpha\"*\\)";
}
assertThat(analysis.getDescription()).containsPattern(pattern);
return "@org.springframework.beans.factory.annotation.Qualifier\\(value=\"*alpha\"*\\)";
}
@Test

Loading…
Cancel
Save