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

org.mockito.stubbing.answers.ReturnsElementsOf Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2007 Mockito contributors
 * This program is made available under the terms of the MIT License.
 */
package org.mockito.stubbing.answers;

import java.util.Collection;

/**
 * Returns elements of the collection. Keeps returning the last element forever.
 * Might be useful on occasion when you have a collection of elements to return.
 * 

*


 *   //this:
 *   when(mock.foo()).thenReturn(1, 2, 3);
 *   //is equivalent to:
 *   when(mock.foo()).thenReturn(new ReturnsElementsOf(Arrays.asList(1, 2, 3)));
 * 
* * @deprecated Use {@link org.mockito.AdditionalAnswers#returnsElementsOf} */ @Deprecated public class ReturnsElementsOf extends org.mockito.internal.stubbing.answers.ReturnsElementsOf { @Deprecated public ReturnsElementsOf(Collection elements) { super(elements); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy