use of org.mockito.internal.stubbing.StubbingComparator in project mockito by mockito.
the class AllInvocationsFinder method findStubbings.
/**
* Gets all stubbings from mocks. Invocations are ordered earlier first.
*
* @param mocks mocks
* @return stubbings
*/
public static Set<Stubbing> findStubbings(Iterable<?> mocks) {
Set<Stubbing> stubbings = new TreeSet<Stubbing>(new StubbingComparator());
for (Object mock : mocks) {
Collection<? extends Stubbing> fromSingleMock = new DefaultMockingDetails(mock).getStubbings();
stubbings.addAll(fromSingleMock);
}
return stubbings;
}
use of org.mockito.internal.stubbing.StubbingComparator in project mockito by mockito.
the class DefaultMockingDetails method getStubbings.
@Override
public Collection<Stubbing> getStubbings() {
List<? extends Stubbing> stubbings = mockHandler().getInvocationContainer().getStubbedInvocations();
TreeSet<Stubbing> out = new TreeSet<Stubbing>(new StubbingComparator());
out.addAll(stubbings);
return out;
}
Aggregations