Commit e5394cea authored by Stephane Nicoll's avatar Stephane Nicoll

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

See gh-20180
parent e22aca85
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment