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

org.mockito.junit.MockitoJUnit Maven / Gradle / Ivy

There is a newer version: 5.13.0
Show newest version
package org.mockito.junit;

import org.mockito.Incubating;
import org.mockito.internal.junit.JUnitRule;
import org.mockito.internal.junit.VerificationCollectorImpl;
import org.mockito.internal.util.ConsoleMockitoLogger;

/**
 * The JUnit rule can be used instead of {@link org.mockito.runners.MockitoJUnitRunner}. See {@link MockitoRule}.
 *
 * @since 1.10.17
 */
public class MockitoJUnit {

    /**
     * Creates rule instance that initiates @Mocks
     * For more details and examples see {@link MockitoRule}.
     *
     * @return the rule instance
     * @since 1.10.17
     */
    public static MockitoRule rule() {
        return new JUnitRule(new ConsoleMockitoLogger(), false);
    }

    /**
     * Creates a rule instance that can perform lazy verifications.
     *
     * @see VerificationCollector
     * @return the rule instance
     * @since 2.1.0
     */
    @Incubating
    public static VerificationCollector collector() {
        return new VerificationCollectorImpl();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy