In an integration test class I met these lines of code:
@ClassRule
public static final SpringClassRule SPRING_CLASS_RULE = new SpringClassRule();
@Rule
public final SpringMethodRule springMethodRule = new SpringMethodRule();
When I try to navigate to the class (I use Intellij Idea) I get 'Cannot find declaration to go to'. When I try to find usage I get 'No usage found in the project' I am familiar with concept of Rules. But still don't understand what do these two things do. I checked this page: https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/ no info there.
These aren't Spring Boot specific annotations, rather from the Spring Framework itself and allow use of Spring Contexts etc. without the use of the SpringRunner
.
Javadoc, http://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/context/junit4/rules/SpringClassRule.html
A concrete example can be found here,
http://eddumelendez.github.io/blog/2015/08/01/spring-4-2-0-springclassrule-and-springmethodrule/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With