All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fitbur.mockito.internal.debugging.WarningsPrinterImpl Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
/*
 * Copyright (c) 2007 Mockito contributors
 * This program is made available under the terms of the MIT License.
 */
package com.fitbur.mockito.internal.debugging;

import com.fitbur.mockito.internal.invocation.InvocationMatcher;
import com.fitbur.mockito.invocation.Invocation;

import java.util.List;

public class WarningsPrinterImpl {

    private final boolean warnAboutUnstubbed;
    private final WarningsFinder finder;

    public WarningsPrinterImpl(List unusedStubs, List allInvocations, boolean warnAboutUnstubbed) {
        this(warnAboutUnstubbed, new WarningsFinder(unusedStubs, allInvocations));
    }

    WarningsPrinterImpl(boolean warnAboutUnstubbed, WarningsFinder finder) {
        this.warnAboutUnstubbed = warnAboutUnstubbed;
        this.finder = finder;
    }

    public String print() {
        LoggingListener listener = new LoggingListener(warnAboutUnstubbed);
        finder.find(listener);
        return listener.getStubbingInfo();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy