Class MatcherToString
java.lang.Object
org.mockito.internal.matchers.text.MatcherToString
Provides better toString() text for matcher that don't have toString() method declared.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static String
toString
(ArgumentMatcher<?> matcher) Attempts to provide more descriptive toString() for given matcher.
-
Constructor Details
-
MatcherToString
private MatcherToString()
-
-
Method Details
-
toString
Attempts to provide more descriptive toString() for given matcher. Searches matcher class hierarchy for toString() method. If it is found it will be used. If no toString() is defined for the matcher hierarchy, uses decamelized class name instead of default Object.toString(). This way we can promote meaningful names for custom matchers.- Parameters:
matcher
-- Returns:
-