Improve @PropertyMapping error message
Improve the message thrown when a @PropertyMapping is used in combination with a @Component to include the actual annotations that are causing the problem. Fixes gh-5897
This commit is contained in:
@@ -107,8 +107,9 @@ public class PropertyMappingContextCustomizerFactoryTests {
|
||||
context.register(ConfigMapping.class);
|
||||
customizer.customizeContext(context, null);
|
||||
this.thrown.expect(BeanCreationException.class);
|
||||
this.thrown.expectMessage(
|
||||
"@PropertyMapping annotations can only be used on test classes");
|
||||
this.thrown.expectMessage("The @PropertyMapping annotation "
|
||||
+ "@PropertyMappingContextCustomizerFactoryTests.TypeMappingAnnotation "
|
||||
+ "cannot be used in combination with the @Component annotation @Configuration");
|
||||
context.refresh();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user