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 the
toStringWithType(String)
method.-
Method Summary
Modifier and TypeMethodDescriptiontoStringWithType
(String className) boolean
typeMatches
(Object target) Checks if target target has matching type.
-
Method Details
-
toStringWithType
- Parameters:
className
- - name of the class to be printed in description Returns more verbose description of the object which include type information
-
typeMatches
Checks if target target has matching type. If the type matches, there is no point in rendering result fromtoStringWithType(String)
-
getWanted
Object getWanted()- Returns:
- Returns the wanted argument
-