Package org.mockito.internal.exceptions.stacktrace

Examples of org.mockito.internal.exceptions.stacktrace.StackTraceFilter


    private static final long serialVersionUID = -9054861157390980624L;
    private final Throwable stackTraceHolder;
    private final StackTraceFilter stackTraceFilter;

    public LocationImpl() {
        this(new StackTraceFilter());
    }
View Full Code Here


    }

    @Test
    public void shouldBeSafeInCaseForSomeReasonFilteredStackTraceIsEmpty() {
        //given
        StackTraceFilter filterReturningEmptyArray = new StackTraceFilter() {
            @Override
            public StackTraceElement[] filter(StackTraceElement[] target, boolean keepTop) {
                return new StackTraceElement[0];
            }
        };
View Full Code Here

        }
    }

    private boolean hasBeenCaughtByMockitoProxy() {
        StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
        StackTraceFilter filter = new StackTraceFilter();
        /*
        * We filter the stack-trace to check if "Mockito" exists as a stack trace element. (The filter method
        * remove all Mocktio stack trace elements). If the filtered stack trace length is not equal to the original stack trace length
        * this means that the call has been caught by Mockito.
        */
        final StackTraceElement[] filteredStackTrace = filter.filter(stackTrace, true);
        return filteredStackTrace.length != stackTrace.length;
    }
View Full Code Here

TOP

Related Classes of org.mockito.internal.exceptions.stacktrace.StackTraceFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.