Package org.mockito.exceptions

Examples of org.mockito.exceptions.Reporter


    }

    private void assertMatchersFoundFor(String additionalMatcherName) {
        if (matcherStack.isEmpty()) {
            matcherStack.clear();
            new Reporter().reportNoSubMatchersFound(additionalMatcherName);
        }
    }
View Full Code Here


    private void assertIncorrectUseOfAdditionalMatchers(String additionalMatcherName, int count) {
        if(matcherStack.size() < count) {
            ArrayList<LocalizedMatcher> lastMatchers = new ArrayList<LocalizedMatcher>(matcherStack);
            matcherStack.clear();
            new Reporter().incorrectUseOfAdditionalMatchers(additionalMatcherName, count, lastMatchers);
        }
    }
View Full Code Here

     */
    public void validateState() {
        if (!matcherStack.isEmpty()) {
            ArrayList lastMatchers = new ArrayList<LocalizedMatcher>(matcherStack);
            matcherStack.clear();
            new Reporter().misplacedArgumentMatcher(lastMatchers);
        }
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public void verify(VerificationData data) {
        Invocation unverified = new InvocationsFinder().findFirstUnverified(data.getAllInvocations());
        if (unverified != null) {
            new Reporter().noMoreInteractionsWanted(unverified, (List) data.getAllInvocations());
        }
    }
View Full Code Here

    public void verifyInOrder(VerificationDataInOrder data) {
        List<Invocation> invocations = data.getAllInvocations();
        Invocation unverified = new InvocationsFinder().findFirstUnverifiedInOrder(data.getOrderingContext(), invocations);
       
        if (unverified != null) {
            new Reporter().noMoreInteractionsWantedInOrder(unverified);
        }
    }
View Full Code Here

       
        InvocationsFinder finder = new InvocationsFinder();
        List<Invocation> found = finder.findInvocations(invocations, wanted);
        int foundSize = found.size();
        if (foundSize > maxNumberOfInvocations) {
            new Reporter().wantedAtMostX(maxNumberOfInvocations, foundSize);
        }
       
        invocationMarker.markVerified(found, wanted);
    }
View Full Code Here

   
    private final Reporter reporter;
    private final InvocationsFinder finder;
   
    public MissingInvocationChecker() {
        this(new InvocationsFinder(), new Reporter());
    }
View Full Code Here

        if (wanted == null) {
            return;
        }
        ObjectMethodsGuru o = new ObjectMethodsGuru();
        if (o.isToString(wanted.getMethod())) {
            new Reporter().cannotVerifyToString();
        }
    }
View Full Code Here

        return this.rawArguments;
    }

    public Object callRealMethod() throws Throwable {
        if (this.getMethod().getDeclaringClass().isInterface()) {
            new Reporter().cannotCallRealMethodOnInterface();
        }
        return realMethod.invoke(mock, rawArguments);
    }
View Full Code Here

   
    private final Reporter reporter;
    private final InvocationsFinder finder;
   
    public MissingInvocationInOrderChecker() {
        this(new InvocationsFinder(), new Reporter());
    }
View Full Code Here

TOP

Related Classes of org.mockito.exceptions.Reporter

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.