1 /* 2 * Copyright (c) 2017 Mockito contributors 3 * This program is made available under the terms of the MIT License. 4 */ 5 package org.mockito.listeners; 6 7 import org.mockito.Incubating; 8 9 /** 10 * The instance of this class is passed to {@link VerificationStartedListener}. 11 * For all the details, including how and why to use this API, see {@link VerificationStartedListener}. 12 * 13 * @since 2.11.0 14 */ 15 @Incubating 16 public interface VerificationStartedEvent { 17 18 /** 19 * Replaces existing mock object for verification with a different one. 20 * Needed for very advanced framework integrations. 21 * For all the details, including how and why see {@link VerificationStartedListener}. 22 * <p> 23 * If this method is used to replace the mock the sibling method {@link #getMock()} will return the new value. 24 * <strong>CAVEAT:</strong> if {@code setMock(Object)} is invoked multiple times from one or many listeners 25 * the sibling method {@link #getMock()} will return mock that was set by most recent invocation of {@code setMock(Object)}. 26 * 27 * @param mock to be used for verification. 28 * @since 2.11.0 29 */ 30 @Incubating setMock(Object mock)31 void setMock(Object mock); 32 33 /** 34 * The mock object that will be used during verification. 35 * See sibling method {@link #setMock(Object)} for more details. 36 * Please see {@link VerificationStartedListener} for all details of verification started listeners. 37 * 38 * @since 2.11.0 39 */ 40 @Incubating getMock()41 Object getMock(); 42 } 43