1 /* 2 * Copyright (c) 2016 Mockito contributors 3 * This program is made available under the terms of the MIT License. 4 */ 5 package org.mockito.plugins; 6 7 import org.mockito.exceptions.stacktrace.StackTraceCleaner; 8 9 /** 10 * An extension point to register custom {@link StackTraceCleaner}. 11 * You can replace Mockito's default StackTraceCleaner. 12 * You can also 'enhance' Mockito's default behavior 13 * because the default cleaner is passed as parameter to the method. 14 * <p> 15 * Registering custom StackTraceCleaner is done in similar manner as the {@link MockMaker} implementation. 16 * <p> 17 * See the default implementation: {@link org.mockito.internal.exceptions.stacktrace.DefaultStackTraceCleanerProvider} 18 */ 19 public interface StackTraceCleanerProvider { 20 21 /** 22 * Allows configuring custom StackTraceCleaner. 23 * 24 * @param defaultCleaner - Mockito's default StackTraceCleaner 25 * @return StackTraceCleaner to use 26 */ getStackTraceCleaner(StackTraceCleaner defaultCleaner)27 StackTraceCleaner getStackTraceCleaner(StackTraceCleaner defaultCleaner); 28 } 29