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

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

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

import java.util.List;

import org.junit.runner.notification.RunNotifier;
import org.junit.runners.model.InitializationError;
import org.mockito.internal.runners.util.FrameworkUsageValidator;

import com.github.junitrunner.JUnitPlugin;
import com.github.junitrunner.JUnitRunner;

public class MockitoRunner extends JUnitRunner {

    public MockitoRunner(Class klass) throws InitializationError {
        super(klass);
    }

    @Override
    protected List discoverPlugins() throws InitializationError {
        List plugins = super.discoverPlugins();
        plugins.add(new MockitoPlugin(testClass));
        return plugins;
    }

    @Override
    public void run(final RunNotifier notifier) {
        // add listener that validates framework usage at the end of each test
        notifier.addListener(new FrameworkUsageValidator(notifier));

        super.run(notifier);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy