Add getter for @Rule in a RuleChain
See original GitHub issueI have this
@Rule
public ActivityTestRule<MainActivity> mActivityTestRule
= new ActivityTestRule<>(MainActivity.class);
@Rule
public ActivityTestRule<QuizActivity> mQuizActivityRule
= new ActivityTestRule<>(QuizActivity.class, false, false);
public ActivityTestRule<InsectDetailsActivity> mDetailActivityRule
= new ActivityTestRule<>(InsectDetailsActivity.class, false, false);
@Rule
public RuleChain rules = RuleChain.outerRule(mActivityTestRule)
.around(mQuizActivityRule)
.around(mDetailActivityRule);
I want to do something like
rules.getrule().around(0).launchActivity();
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Don't be lazy, use @Rules - Nicola Corti
In this way, getters and setters for timingRule won't be created and it will be exposed as a field. Conclusions. Do you want...
Read more >RuleChain (JUnit API)
The RuleChain rule allows ordering of TestRules. You create a RuleChain with outerRule(TestRule) and subsequent calls of around(TestRule) :
Read more >How can I use @Rule? - Kotlin Discussions
You can now achieve this with the @JvmField annotation, which instructs the compiler not to generate a getter or setter, and expose it...
Read more >Kotlin and new ActivityTestRule : The @Rule must be public
JUnit allows providing rules through a test class field or a getter method. What you annotated is in Kotlin a property though, which...
Read more >Ordering your JUnit Rules using a RuleChain - hasCode.com
Adding JUnit; Rule definition; Applying the Rule to a Test Case; Ordering Rules with RuleChains; Ordering ClassRules with RuleChains ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t see how we could write a signature for your proposed method that would not require a cast.
@panchenko Thanks for that. But I still think that feature is worth implementing.