1 /* 2 * Copyright (c) 2007 Mockito contributors 3 * This program is made available under the terms of the MIT License. 4 */ 5 package org.mockito.internal.debugging; 6 7 import org.mockito.internal.invocation.InvocationMatcher; 8 import org.mockito.internal.invocation.UnusedStubsFinder; 9 import org.mockito.internal.invocation.finder.AllInvocationsFinder; 10 import org.mockito.invocation.Invocation; 11 12 import java.util.LinkedList; 13 import java.util.List; 14 15 @Deprecated 16 public class WarningsCollector { 17 18 private final List<Object> createdMocks; 19 20 public WarningsCollector() { 21 createdMocks = new LinkedList<Object>(); 22 } 23 24 public String getWarnings() { 25 List<Invocation> unused = new UnusedStubsFinder().find(createdMocks); 26 List<Invocation> all = AllInvocationsFinder.find(createdMocks); 27 List<InvocationMatcher> allInvocationMatchers = InvocationMatcher.createFrom(all); 28 29 return new WarningsPrinterImpl(unused, allInvocationMatchers, false).print(); 30 } 31 } 32