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

com.fitbur.mockito.MockingDetails Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
/*
 * Copyright (c) 2007 Mockito contributors
 * This program is made available under the terms of the MIT License.
 */
package com.fitbur.mockito;

import com.fitbur.mockito.invocation.Invocation;

import java.util.Collection;
import java.util.Set;

/**
 * Provides mocking information.
 * For example, you can identify whether a particular object is either a mock or a spy.
 *
 * @since 1.9.5
 */
public interface MockingDetails {
    
    /**
     * Informs if the object is a mock. isMock() for null input returns false.
     * @return true if the object is a mock or a spy.
     *
     * @since 1.9.5
     */
    boolean isMock();

    /**
     * Informs if the object is a spy. isSpy() for null input returns false.
     * @return true if the object is a spy.
     *
     * @since 1.9.5
     */
    boolean isSpy();
    
    /**
     * Provides a collection of methods indicating the invocations of the object
     * @return collection of Invocation representing the invocations 
     * for the object.
     *
     * @since 1.10.0
     */
    Collection getInvocations();


    /**
     * Returns the type that is mocked. It is the type originally passed to
     * the {@link Mockito#mock(Class)} or {@link Mockito#spy(Class)} function,
     * or the type referenced by a Mockito annotation.
     *
     * @return The mocked type
     * @since 2.0.0
     */
    Class getMockedType();

    /**
     * Returns the extra-interfaces of the mock. The interfaces that were configured at the mock creation
     * with the {@link MockSettings#extraInterfaces(Class[])}.
     *
     * @return The extra-interfaces
     * @since 2.0.0
     */
    Set getExtraInterfaces();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy