mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-21 05:09:13 +00:00
Add FeatureMethodErrorTests
Capture common mistakes with @Feature method declarations and ensure that useful error messages are produced. git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3966 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
+2
-1
@@ -322,7 +322,8 @@ public class ConfigurationClassPostProcessor implements BeanDefinitionRegistryPo
|
||||
if (!(FeatureSpecification.class.isAssignableFrom(featureMethod.getReturnType()))) {
|
||||
// TODO SPR-7420: raise a Problem instead?
|
||||
throw new IllegalArgumentException(
|
||||
"return type from @Feature methods must be assignable to FeatureSpecification");
|
||||
format("Return type for @Feature method %s.%s() must be assignable to FeatureSpecification",
|
||||
featureMethod.getDeclaringClass().getSimpleName(), featureMethod.getName()));
|
||||
}
|
||||
|
||||
List<Object> beanArgs = new ArrayList<Object>();
|
||||
|
||||
Reference in New Issue
Block a user