java - What is the alternative to @RunWith(JMock.class)? -


we have moved java 1.7 , jmock.class deprecated. there alternative? seems website has been abandoned...

you want junitrulemockery rule.

public class testsomething {     @rule     public final junitrulemockery context = new junitrulemockery();      @mock     private myinterface interface;      @test     public void testthething() {         context.checking(new expectations{{           }});         // etc.     } 

you'll need jmock-junit4 dependency on classpath...

        <dependency>             <groupid>org.jmock</groupid>             <artifactid>jmock-junit4</artifactid>             <version>2.8.1</version>             <scope>test</scope>         </dependency> 

Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -