java - Multiple Rules in JUnit -


I have defined two rules defined in one of the test classes, but the strange thing is that one of them works at one time - One defined the last.

  @Rule public expected exception exception = ExpectedException.none (); @ Rules Public floating folder folder = new temporary folder ();  

How do I define two or more rules for my life and how to use them separately

I had a single problem, and I found that in that case you can use Rule China, like:

  Public floating folders; Thousands of hope of hope; @Rules Public Test Rules Series = Rule Chain.outerRule (temp = new TemporaryFolder ()) .Round (Throwed = Expected Exception.none ());  

You can see another example, and it can also help.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -