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

org.mockito.internal.matchers.ContainsExtraTypeInfo Maven / Gradle / Ivy

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

/**
 * Intended to use in certain ArgumentMatchers.
 * When ArgumentMatcher fails, chance is that the actual object has the same output of toString() than
 * the wanted object. This looks weird when failures are reported.
 * Therefore when matcher fails but toString() yields the same outputs,
 * we will try to use the {@link #toStringWithType()} method.
 */
public interface ContainsExtraTypeInfo {

    /**
     * Returns more verbose description of the object which include type information
     */
    String toStringWithType();

    /**
     * Checks if target target has matching type.
     * If the type matches, there is no point in rendering result from {@link #toStringWithType()}
     */
    boolean typeMatches(Object target);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy