Package org.mockito.internal.matchers
Interface ContainsExtraTypeInfo
-
- All Known Implementing Classes:
ArrayEquals
,Equals
public interface ContainsExtraTypeInfo
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 thetoStringWithType(String)
method.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Object
getWanted()
java.lang.String
toStringWithType(java.lang.String className)
boolean
typeMatches(java.lang.Object target)
Checks if target target has matching type.
-
-
-
Method Detail
-
toStringWithType
java.lang.String toStringWithType(java.lang.String className)
- Parameters:
className
- - name of the class to be printed in description Returns more verbose description of the object which include type information
-
typeMatches
boolean typeMatches(java.lang.Object target)
Checks if target target has matching type. If the type matches, there is no point in rendering result fromtoStringWithType(String)
-
getWanted
java.lang.Object getWanted()
- Returns:
- Returns the wanted argument
-
-