Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Using Mockito in Jnario
package demo
import static org.mockito.Mockito.*
import static org.mockito.MockitoAnnotations.*
import java.util.List
import org.mockito.Mock
import org.jnario.runner.CreateWith
describe "Mockito"{
describe "standard"{
val mock = mock(typeof(List))
fact mock should not be null
describe "annotation"{
@Mock List mock
before initMocks(this)
fact mock should not be null
describe "instantiator"{
@Mock List mock
fact mock should not be null
package demo;
import org.jnario.runner.SimpleSpecCreator;
import org.mockito.MockitoAnnotations;
public class MockitoInstantiator extends SimpleSpecCreator {
public <T> T createSpec(Class<T> klass) {
T test = super.createSpec(klass);
return test;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.