-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Provide mechanism to order the sequence of @Before*
and @After*
lifecycle methods
#87
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
Comments
Just noticed there is RuleChain. https://github.com/junit-team/junit/wiki/Rules#rulechain |
This issue is closely related to #13. |
I think it could be rather easily solved by having a position property in the @Before/AfterEach/All annotations. This would allow to use the existion Position values (e.g. OUTERMOST, INNERMOST, INSIDE, OUTSIDE). A relative position would require more work. |
I believe that this is a different use-case here. We should not mix extensions and the Before/After annotations. Also, I am still very unhappy with these limited positions.
So for this use-case it might be better to allow explicit ordering for the test writer. This is related to the Scenario testing we already discussed. Thoughts?
|
Before/After annotations are already implemented as extension points. 2016-02-04 17:55 GMT+01:00 Stefan Bechtold [email protected]:
|
We used the extension point registry internally, but this is different to the test writer. Before/After are not extension points themselves. IMO providing an order (like we are discussing to provide for Scenario Testing) would be both: Easier and more consistent to the test writer. |
I need to see a concrete use case to get a feeling for what would be a good approach. Can you think of one?
|
If we will add a feature to ensure the order of before/after/test methods it will be in the context of scenario tests (cf. #48). |
@Before*
and @After*
lifecycle methods
It would be great to allow explicit control of ordering things such as
@BeforeEach
,@AfterEach
,@BeforeAll
,@AfterAll
, and extensions.My use case from JUnit 4 is that I have a
WireMock
instance that I want to shutdown via@Rule
after some other@Rule
's.The text was updated successfully, but these errors were encountered: