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
Post a Comment