-
Notifications
You must be signed in to change notification settings - Fork 38.5k
SPR-12031 Support @ContextConfiguration at method level #1255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a8bb1f2
to
4f7aed0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please apply the requested changes in order to reduce the amount of noise in this commit.
Thanks!
import org.springframework.stereotype.Component; | ||
import org.springframework.util.ClassUtils; | ||
import org.springframework.util.ReflectionUtils; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, contributors are required to adhere to the Spring Framework Code Style. So please familiarize yourself with that and rework your PR.
For example, you need to undo all changes to import ordering and static imports throughout all changed classes.
assertTrue(isAnnotationDeclaredLocally(Order.class, NonInheritedAnnotationClass.class)); | ||
assertFalse(isAnnotationDeclaredLocally(Order.class, SubNonInheritedAnnotationClass.class)); | ||
} | ||
// non-inherited class-level annotation; note: @Order is not inherited |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears that you formatted code that you have not authored or modified, which is not permissible according to Spring's coding guidelines.
Also, it appears you may be using the wrong indentation settings.
@@ -105,7 +110,7 @@ | |||
} | |||
|
|||
// Declared locally? | |||
if (AnnotationUtils.isAnnotationDeclaredLocally(annotationType, clazz)) { | |||
if (isAnnotationDeclaredLocally(annotationType, clazz)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Production code is not allowed to use static imports.
@sbrannen |
It's definitely forbidden in production code. In test code, I think there are few places where that style is used. But I don't want that in the Thanks |
4f7aed0
to
e3d8c85
Compare
Prior Spring TestContext Framework had not supported @ContextConfiguration annotation on the method-level. This commit enables @ContextConfiguration and @ContextHierarchy to be the method-level annotations. Now TCF will emit fully configured throw-away TestContext for the particular test method. Issue: SPR-12031
e3d8c85
to
ae37c63
Compare
@sbrannen |
Prior Spring TestContext Framework had not supported
@ContextConfiguration annotation on the method-level.
This commit enables @ContextConfiguration and
@ContextHierarchy to be the method-level annotations.
Now TCF will emit fully configured throw-away
TestContext for the particular test method.
Issue: SPR-12031