All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.mockito.internal.junit.JUnitRule Maven / Gradle / Ivy

There is a newer version: 2.0.2-beta
Show newest version
package org.mockito.internal.junit;

import org.junit.runners.model.Statement;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;

/**
 * Internal implementation.
 */
public class JUnitRule {
    public Statement apply(final Statement base, final Object target) {
        return new Statement() {
            @Override
            public void evaluate() throws Throwable {
                MockitoAnnotations.initMocks(target);
                base.evaluate();
                Mockito.validateMockitoUsage();
            }
        };
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy