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

com.github.junitrunner.mockito.MockitoInitStatement Maven / Gradle / Ivy

There is a newer version: 0.0.2
Show newest version
package com.github.junitrunner.mockito;

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

public class MockitoInitStatement extends Statement {

    private final Statement statement;
    private final Object testObject;

    public MockitoInitStatement(Statement statement, Object testObject) {
        this.statement = statement;
        this.testObject = testObject;
    }

    @Override
    public void evaluate() throws Throwable {
        MockitoAnnotations.initMocks(testObject);
        statement.evaluate();
        Mockito.validateMockitoUsage();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy